Jump to content

how to get data between two same dates when datefield is DATETIME


SUNIL16

Recommended Posts

Hi friends

 

How to get data  between two same dates my query is working for timestamp 00:00:00

 

below is my query

 

SELECT ACTIVITY_TYPE,,date_format(ACTIVITY_DATE,'%Y/%m/%d') as logdate FROM activity_log WHERE ACTIVITY_DATE BETWEEN STR_TO_DATE('10/12/2010','%d/%m/%Y') and  STR_TO_DATE('10/12/2010,'%d/%m/%Y')

 

values in table

type  date

a        10/12/2010 11:39:43

b        10/12/2010 13:39:43

c        10/12/2010 14:39:43

 

my above query will work and returns these 3 rows  wen data is like this

a        10/12/2010 00:00:00

b        10/12/2010 00:00:00

c        10/12/2010 00:00:00

 

but when time is there how to fetch data

 

any ideas

 

thanks

sunil

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.