Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

dealing with dates, MS Access and SQL

  Asked By: Emily    Date: Oct 12    Category: Asp.net    Views: 1264
  

I am having trouble understanding how to treat a variable assigned with a date.
As an example:

zdate = 03/17/2003

when I try to use this in a SELECT statement zdate is recognized as an integer
and Access won't consider it a valid date and no records are found. If I try
this:

strSQL = "SELECT * FROM Times WHERE appDate = '"&zdate&"'"

so that the value is a string I get [Microsoft][ODBC Microsoft Access Driver]
Data type mismatch in criteria expression.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Daimon Jones     Answered On: Oct 12

Select * Form Times WHERE appDate = > #"&zdate&"#"

 
Didn't find what you were looking for? Find more on dealing with dates, MS Access and SQL Or get search suggestion and latest updates.




Tagged: