Last post Jul 22, 2011 07:24 PM by hans_v
Jul 22, 2011 11:46 AM|shehz|LINK
I can't seem to list the record when the pickdate is
equal than now date. Please advise
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
SelectCommand="SELECT PickupDate, PickupTime, DropOffDate, DropOffTime, PostedDate, location, Price FROM HotDeals where PickupDate >= Now() ORDER BY PickupDate">
Jul 22, 2011 11:50 AM|bbcompent1|LINK
Can you tell me what format the column pickupdate is in? If its string, you'll have to cast that as a date.
Jul 22, 2011 01:05 PM|shehz|LINK
IT is not a string but a short Date Format. it works fine if the pickupdate is greater or less than todays date but when it is equal to todays date then it doesn't work.
Jul 22, 2011 01:11 PM|bbcompent1|LINK
Hmmm... so your date actually looks like 07/22/11 for example?
Jul 22, 2011 01:31 PM|shehz|LINK
Jul 22, 2011 02:07 PM|bbcompent1|LINK
Ok, take a look here as this can help you format the now() as date time:
Jul 22, 2011 07:24 PM|hans_v|LINK
Now() is returning the date + time. Use Date() instead...
SelectCommand="SELECT PickupDate, PickupTime, DropOffDate, DropOffTime, PostedDate, location, Price FROM HotDeals where PickupDate >=
Date() ORDER BY PickupDate"