tags:

views:

106

answers:

1

Hi,

I am trying to select between two dates, but in the table they have timestamps after them.

Example: calldate is 2010-03-16 22:43:28

How would I select this using calldate between '$date1' AND '$date2' to wildcard the timestamp after the date?

I tried using like but it didn't work

I just want to do between '$date1%' AND '$date2%'

Anyone know how to do this?

Thank you in advance!

A: 

Try casting the value to date only. For example

WHERE DATE(`caldate`) BETWEEN '$date1' AND '$date2'
Ben Rowe
thanks a lot! that worked!good to know, i will remember this for future references.
zx
Can you confirm the answer then by clicking on the 'tick' icon. Thanks! :)
Ben Rowe