Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To Pull records between two dates in db2

Tags:

db2

I tried below two ways they not working

Select * from Table 
where SERV_DATE BETWEEN '03/01/2013'AND    
              '03/31/2013'          

ALSO This is not working

Select * from Table 
where SERV_DATE BETWEEN DATE('03/01/2013') AND     
              DATE('03/31/2013')

What should be the correct format ?

like image 678
Agent Mahone Avatar asked Jan 20 '26 00:01

Agent Mahone


1 Answers

SELECT * FROM tableName WHERE date(modifiedBy_date) between '2017-07-28' AND '2017-08-01';

Works cool for DB2.

like image 74
Vinit Bhardwaj Avatar answered Jan 23 '26 08:01

Vinit Bhardwaj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!