Monday, March 12, 2012

How to use Like with DataTime ??...

i want to fetch visitors record by data but visiting date field has time also and i want to get by data only because i am unknown to exact time.

i am using this query but record does not comes.

select * from visitors where in_date_time like '03-05-2007%'

where as i am using visitor name instead of in_data_time it works success fully.

plz solve it.

Jasim...

New Delhi...

to account for the time portion of a datetime, you could do it like this:

select * from visitors where in_date_time >= '03-05-2007' AND in_date_time < '03-06-2007'

this would select all records from 03-05-2007 regardless of their time.

No comments:

Post a Comment