SQL/MS Access 2000 date query

Results 1 to 2 of 2

Thread: SQL/MS Access 2000 date query

  1. #1
    Kaustav Bhattacharya Guest

    Default SQL/MS Access 2000 date query

    Greetings,<BR>I have an MSAccess2000 db on my web server. I would like to retreive all records from table "foo" where the date is greater than the date stated in the HTML form. The HTML form builds a date from three variables for day, month and year. The free values at concatonated into one vairable called "StartDate". I have a SQL statement similar to the following but it doesn&#039t seem to work. Assistance would be appreciated from someone in the know. <BR><BR>StartDate = Request.Form("month") & "/" & (Request.Form("day") & "/" & Request.Form("year"))<BR><BR>SELECT * FROM foo WHERE start_date &#062; StartDate<BR><BR>I suspect I need to do some form of type casting to convert the variable string "StartDate" to "Date" format or something similiar to that. Does anyone have correct SQL code and syntax to ge this query to work?<BR><BR>Many thank,<BR>Kaustav

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL/MS Access 2000 date query

    Try "wrapping" the StartDate variable with #&#039s<BR><BR>i.e. strSQL = "SELECT * FROM foo WHERE start_date &#062; #" & StartDate & "# "<BR><BR><BR>HTH<BR><BR>Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts