You need to put single quotes around the date.
Otherwise it sees your numbers and slashes as some kind of mathematical
equation.
WHERE postdate <= '" & Today & "'"
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"darrel" <notreal@hotmail.com> wrote in message
news:%23v$Mda$LFHA.576@TK2MSFTNGP15.phx.gbl...[color=blue]
> I'm grabbing today's date with some ASP.net code:
>
> Dim Today As Date
> Today = Microsoft.VisualBasic.Today()
>
> I'm then trying to run a SQL query with the following WHERE statement:
>
> WHERE postdate <= " & Today & "
>
> But it's pulling up records that have a postdate in the future.
>
> A sample:
>
> Today (when written to screen) = 3/23/2005 12:00:00 AM
> In the SQL table postdate field = 3/28/2005
>
> Anyone see something wrong with what I have that would be causing this? Is
> it because in my code I'm grabbing the time, while SQL is only storing the
> date?
>
> -Darrel
>
>
>[/color]