Still having troubles With dates in SQL
Thanks for your help earlier szlamany.
SQL is so crazy. You have to get it right on or it doesn't work.
How do I handle it the SQL date with a variable?
I'm still getting type mismatch.
Code:
Dim dteDate As Date
dteDate = "#08/13/2004#"
'sql="SELECT * FROM DAILY_SALES_HIST_X WHERE DlvryDte=#8/13/2004#" 'IT WORKS!
'sql="SELECT * FROM DAILY_SALES_HIST_X WHERE CustomerId='010110'" 'IT WORKS!
sql="SELECT * FROM DAILY_SALES_HIST_X WHERE DlvryDte='dteDate'"
Help Please
Thanks
Re: Still having troubles With dates in SQL
For that (or any other kind of variable) you just need to do this:
sql="SELECT * FROM DAILY_SALES_HIST_X WHERE DlvryDte='" & dteDate & "'"
Re: Still having troubles With dates in SQL
SI - this is a bit of a double post - see this other thread...
http://www.vbforums.com/showthread.p...10#post2084210