Results 1 to 3 of 3
  1. #1
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544

    Question Need help with Syntax Error

    I need a fresh set of eyes to look at this code. I've looked at it so many times I think I'm going corss-eyed! I keep getting a general syntax error when I try to run this SQL code. Thanks in advance.

    Code:
    mySQL = "INSERT INTO tblAudit (DOWNLOAD_DT, A$EMPLOYEE_NUMBER, A$FULL_NAME, ASSIGNMENT_STATUS, DATE_OF_HIRE," & _
                        "JOB_NAME, LOCATION, PERSON_TYPE_USAGE, SUPERVISOR_FULL_NAME, THIS_PERIOD_START_DATE, ACTUAL_TERM_DATE," & _
                        "PAY_TYPE, PAY_CHANGE_DATE, PAY_CHANGE_REASON, DATE_IN_JOB, Business_Title) VALUES (#" & vDOWNLOAD_DT & "#, " & vEMPLOYEE_NUMBER & "," & _
                        "'" & vFULL_NAME & "', '" & vASSIGNMENT_STATUS & "', #" & vDATE_OF_HIRE & "#, '" & vJOB_NAME & "', '" & vLocation & "'," & _
                        "'" & vPERSON_TYPE_USAGE & "', '" & vSUPERVISOR_FULL_NAME & "', #" & vTHIS_PERIOD_START_DATE & "#, #" & vACTUAL_TERM_DATE & "#," & _
                        "'" & vPAY_TYPE & "', #" & vPAY_CHANGE_DATE & "#, '" & vPAY_CHANGE_REASON & "', #" & vDATE_IN_JOB & "#, '" & vBusiness_Title & "')"


  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    it will be much help if you provide the information of syntax error.

  3. #3
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    I solved it....Put brackets around A$EMPLOYEE_NUMBER AND A$FULL_NAME. Didn't realize SQL didn't like the "$" in field names.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. IIf Statement Syntax Error
    By shexe in forum Queries
    Replies: 2
    Last Post: 10-06-2010, 08:35 AM
  2. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM
  3. Syntax error
    By smikkelsen in forum Access
    Replies: 6
    Last Post: 04-28-2010, 09:38 AM
  4. Syntax Error
    By KLynch0803 in forum Programming
    Replies: 11
    Last Post: 02-04-2010, 01:45 AM
  5. sql syntax error
    By SMAlvarez in forum Access
    Replies: 1
    Last Post: 03-12-2009, 09:43 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums