Results 1 to 3 of 3

Thread: Whats wrong with this SQL query?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Posts
    2

    Whats wrong with this SQL query?

    Im trying to search a MS Access database for a specific date. Im getting a an error message, translated to english its something like: "typeerror in query". The column's type is a Date/Time with the format short date.

    the query is as follows:
    SELECT Personel.Sign, Personel.Firstname, Personel.Lastname, Absent.Date
    FROM Personel, Absent
    WHERE Absent.Date = '" & datetimepicker.Value.Date & "' AND Personel.Sign = Absent.Teacher_Sign

    Would really appreciate help

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    #" & Format(DateTimePicker1.Value, "MM/dd/yyyy") & "# is how date comparisons should be made

    i.e the date enclosed in # and in the fomrat of MM/dd/yyyy

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Posts
    2
    Sweet, was the ' instead of the # surrounding the phrase that messed it up. Thanks a bunch!

Posting Permissions

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



Click Here to Expand Forum to Full Width