I am using SQL 2005 and I am getting this error Incorrect syntax near 0. I am trying to do an insert statement and I am getting this error. I am adding new information into this table by copying existing information from the same table. I am using the replace function for the first time so that might be the issue. I am trying to change what is in the uci,clntid,csfile and arfile columns. For the csfile and arfile columns I am trying to change the first three characters with the letters FCN. Any help is appreciated.
Tom
Tom
Code:
INSERT INTO rptdata_monthly.dbo.rpt_FYInfo
(uci,clntid,rptpd,rptpddiff,fy,fyord,fydiff,imp,csfile,arfile,0,0,0,0,0,0,0,pfy,cy,qtr,fyoff,mon_shnm,monasdt,days,Last3mondys,Lastdayasdt,arch)
SELECT 'FCN',181,rptpd,rptpddiff,fy,fyord,fydiff,imp,REPLACE(csfile,3,'FCN'),REPLACE(arfile,3,'FCN'),begar,chgs,debits,adjcontr,adjoth,pmts,endar,pfy,cy,qtr,fyoff,mon_shnm,monasdt,days,Last3mondys,Lastdayasdt,arch
FROM rptdata_monthly.dbo.rpt_FYInfo
WHERE uci='FCW' and rptpd =373