Community discussion forum

how to compare date sql select query while access records from database(MS Access)

  • 9 months ago
    Hello, I have one sql query in which i comparing the date and search record, but there is problem occurs when i compare date less then current date. i have table(in access):having field name(date) type(varchar) and my query is: "select * from status where date<'"& date.today &"'" it will show wrong result: it compare only day ex: 23/feb/2009<12/mar/2009 result 23 feb 2009 please help thanks
    Post was edited on 25/02/2009 07:26:37 Report abuse
  • 8 months ago
    if you are working with MSAccess enclose the date variable with # sign. e.g. "select * from table1 where dob<#" & today &"#"
  • 8 months ago
    hi.. select * from status where date< cdate('" & date.today & "')" this is gona work 110%... enjoy programming.. SaAd AAli..
  • 8 months ago
    Hi,there are many computer ebooks free download. [url=http://www.51cnnet.net]free ebook download[/url] such as:c++,csharp,adobe,ajax,asp.net,head-first,java,linux,my sql,oracle,perl,ruby,rails,python,acess,visual basic

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback