Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Posts
    395

    Unanswered: format date in SQL statement

    I'm trying to reformat the date field using format function in the SQL statement and it's giving me an error.

    This is how my SQL statement looks like:
    sqlState = sqlState & " [qryUnion].[Other], Format([qryUnion].[Date], "mm/dd/yyyy");"

    Compile error:
    Expected: end of statement

    It's highlighting mm in the date format.
    I tried without the "" but it came back with parameter dialog box referencing mm dd yyyy.

    Can tell why it won't work or How else I can write it?

    Thanks!!

  2. #2
    Join Date
    Dec 2002
    Posts
    18

    quotes misery

    I think acces is having troubles with the quotes, try this:

    sqlState = sqlState & " [qryUnion].[Other], Format([qryUnion].[Date], '" & "mm/dd/yyyy" & "');"

  3. #3
    Join Date
    May 2002
    Posts
    395

    Re: quotes misery

    Originally posted by Poppekop
    I think acces is having troubles with the quotes, try this:

    sqlState = sqlState & " [qryUnion].[Other], Format([qryUnion].[Date], '" & "mm/dd/yyyy" & "');"
    Thanks for the idea!
    Have a Good Day!

Posting Permissions

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