ASP - MS Access Date

am using ASP with MS Access
in the database i have InvDate as DateTime, format: 14/11/2011
I want to get invoices Dated 14/11/2011

strSQL = "SELECT * FROM invoice WHERE invdate = CDATE('14/11/2011')"
works FINE!
Now if I am taking 14/11/2011 through form, I will save it in a variable say...
strSearch = Request.Form("txtSearch")
what will be my SQL statement?

THESE DONT WORK:
strSQL = "SELECT * FROM invoice WHERE invdate = '" & Convert.ToDateTime(strSearch) & "'"
strSQL = "SELECT * FROM invoice WHERE invdate = '#" & CDATE(Request.Form("search")) &"#'"
strSQL = "SELECT * FROM invoice "WHERE invdate = '"& strSearch &"'"

Can anyone help me out... tks.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories