Hello all,
I have a table that I am trying to select records from where the record is greater or equal to one date and equal or less than another date, I have found answers on BETWEEN two dates but not on less/more and equal to:
i.e:
what I am trying to acheive:
Code:
select user_id, start_dstamp, end_dstamp
from users u
where DATE(u.start_dstamp)<=DATE('2009-9-30')
AND DATE(u.end_dstamp)>=DATE('2009-9-30')
ORDER BY start_dstamp
;
however i always get no results found?
the data in the table:
Code:
select user_id, start_dstamp, end_dstamp from users;
user_id, start_dstamp, end_dstamp
1 2009-08-11 00:00:00 2009-08-11 23:59:00
4 2009-08-24 00:00:00 2009-08-24 23:59:00
10 2009-08-28 00:00:00 2009-08-28 23:59:00
14 2009-09-10 12:00:00 2009-09-10 00:00:00
16 2009-09-28 00:00:00 2009-09-30 23:59:00
start_dstamp and end_dstamp are both type datetime.
could someone show me what the correct syntax for this would be?
cheers in advance, trscookie.