i have date column in my database in dd-mm-yyyy
format.
i want to search the data between two dates.
i tried
SELECT * FROM t_data where orderdate between '01-05-2012 00:00:00' and '31-05-2012 23:59:59'
and
SELECT * FROM t_data where orderdate >= '05-05-2012' and orderdate <='31-05-2012'
How to resolve this issue?
use :
select * from tbl_name where Attribute_name between 'yyyy-mm-dd' and 'yyyy-mm-dd';
here Attribute_name is date_time
column name
example :
select * from tbl_node where mydate between '2014-02-02' and '2014-02-06';
1|1|123|456|12eb-ab|1|1|254|123|19|2014-02-03 16:00:44
2|1|123|456|12eb-ab|1|1|254|123|19|2014-02-03 16:01:03
3|1|123|456|12eb-ab|1|1|254|123|19|2014-02-03 16:00:57
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With