If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Insert Command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-11-04, 22:42
sylviayoong sylviayoong is offline
Registered User
 
Join Date: Mar 2004
Location: Malaysia
Posts: 2
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****nSQL 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()'
Reply With Quote
  #2 (permalink)  
Old 03-12-04, 02:10
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
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';"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On