Active Server Pages

Moderators: None (Apply to moderate this forum)
Number of threads: 1751
Number of posts: 4473

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
ASP - MS Access Date Posted by advancechip on 5 Mar 2012 at 6:59 AM
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.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.