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

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.