Last post Jun 09, 2011 03:02 PM by priyank.thakkar
Jun 09, 2011 10:59 AM|priyank.thakkar|LINK
For the above mentioned table I am executing this query: SELECT Room_ID, Format(Booking_ToDate,'dd/mm/yyyy') FROM Bookings WHERE Format(Booking_ToDate,'dd/mm/yyyy')>=Format(Date(),'dd/mm/yyyy')
and the output i am getting is :
The value of Format(Date(),'dd/mm/yyyy') i am geting is 09/06/2011, still it is showing rows having date 16/2/2011 and 22/03/2011. Please guide me with query.
N.B. the format for columns Booking_From and Booking_ToDate is already set to 'dd/mm/yyyy' format from the design view of table 'Bookings.'
Jun 09, 2011 11:13 AM|MarcoAlv|LINK
If you want to compare dates why don't you try this
WHERE DATEDIFF(day,startdate,enddate) > 0
Jun 09, 2011 02:58 PM|priyank.thakkar|LINK
This doesn't work with MS Access
Jun 09, 2011 03:02 PM|priyank.thakkar|LINK
Thanks... it is working..... just the way we pass the parameter is lil diff for access.... for access it WHERE DATEDIFF('d'.startdate,enddate) > 0 :) :) thanks a lot marco :)