Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Using Date/Time for a SQL SELECT WHERE clause (VB Script using ASP 3.0)


Message #1 by "Kevin Smith" <kevin@n...> on Thu, 24 Oct 2002 14:16:16
Hi,

I never thought I'd have this problem.... can anyone explain why the 
following wouldn't work?

Dim getDate
getDate = Date & " " & Time

rsGetBasketID.Source = "SELECT am_basket_header.basket_id FROM 
am_basket_header WHERE am_basket_header.order_date=#" & CDate(getDate) 
& "#"

Basically, this query will not return the "basket_id", but if I output the 
completed SQL statement to the browser and then paste it into MS Access it 
execute perfectly... is there something missing concerning the date format 
or something I don't know.

All my other SQL statements, only one's with dates in the where clause 
don't. :(

Many thanks for your help in advance.

Kevin Smith

  Return to Index