Results 1 to 2 of 2

Thread: Insert Command

  1. #1
    Join Date
    Mar 2004
    Location
    Malaysia
    Posts
    2

    Unanswered: Insert Command

    strSQL = "INSERT INTO SYSADM_PS_ADP_CONTRACTORS" ' (EMPLID,EFFDT,NATIONAL_ID,NAME,PER_STATUS,ORIG_HIR E_DT,HIRE_DT,BIRTHDATE,REHIRE_DT,TERMINATION_DT,DE PTID,JOBCODE,EMPL_STATUS,ACTION,ACTION_DT,ACTION_R EASON,LOCATION,EMPL_TYPE,DEPTNAME,DEPTNAME_ABBRV,M ANAGER_ID)"

    strSQL = strSQL & "VALUES (EMPLID,EFFDT,NATIONAL_ID,NAME,PER_STATUS,ORIG_HIR E_DT,HIRE_DT,BIRTHDATE,REHIRE_DT,TERMINATION_DT,DE PTID,JOBCODE,EMPL_STATUS,ACTION,ACTION_DT,ACTION_R EASON,LOCATION,EMPL_TYPE,DEPTNAME,DEPTNAME_ABBRV,M ANAGER_ID)"

    strSQL = strSQL & "SELECT EFFDT,PER_STATUS,HIRE_DT,REHIRE_DT,DEPTID,JOBCODE, EMPL_STATUS,ACTION_DT,ACTION_REASON,EMPL_TYPE,DEPT NAME,DEPTNAME_ABBRV"
    strSQL = strSQL & "FROM SYSADM_PS_ADP_CONTRACTORS"

    strSQL = strSQL & "HAVING EFFDT LIKE 'CURDATE()',PER_STATUS='E',HIRE_DT=ORIG_HIRE_DT,RE HIRE_DT IS NULL, ACTION_DT IS NULL, ACTION_REASON IS NULL,EMPL_TYPE='H';"

    DoCmd.RunSQL strSQL

    ***There is an error which i don't know how to correct***

    Error Message:
    Run Time Error '3075'
    Syntax error(missing operator) in query expression
    DEPTNAME_ABBRVFROMSYSADM_PS_ADP_CONTRACTORSHAVING EFFDT LIKE 'CURDATE()'

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Perhaps you should use a space at the beginning of every new string ... for example,
    strSQL = strSQL & " FROM SYSADM_PS_ADP_CONTRACTORS"

    strSQL = strSQL & " HAVING EFFDT LIKE 'CURDATE()',PER_STATUS='E',HIRE_DT=ORIG_HIRE_DT,RE HIRE_DT IS NULL, ACTION_DT IS NULL, ACTION_REASON IS NULL,EMPL_TYPE='H';"

Posting Permissions

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