Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
vicki
Posting Yak Master
117 Posts |
Posted - 2002-03-22 : 13:52:52
|
| Hi,I have the sysn tax error but I really don't know how to correct itIncorrect syntax near the keyword 'If'.Line 19: Incorrect syntax near 'ParentOfficeCode'thanks=====================INSERT INTO FieldOfficeInformation (OfficeCode, OfficeName,OfficeTypeCode,OfficeType, ParentOfficeCode, AreaOfficeCode, RegionCode, RegionLetter,AreaNumber, ReportsToOfficeCode, RegionNumber)SELECT FO.OCD as OfficeCode, NM as OfficeName, OFC.OFC_TYP asOfficeTypeCode,OFC_TYP_TXT as OfficeType, FO.PRNT_OCD as ParentOfficeCode, FO.ADOCD as AreaOfficeCode, FO.ROCD as RegionCode, AREA.ROLTR as RegionLetter,AREA.ADONUM as AreaNumber, IIf (NZ ([ParentOfficeCode], " ")=" ",[AreaOfficeCode],[ParentOfficeCode]) as ReportsToOfficeCode, RO.RONUM as RegionNumberFROM FONew as FO LEFT JOIN OFCNew as OFC ON FO.OCD = OFC.OCDLEFT JOIN OCDASGNNew as OCDASGN ON OFC.OFC_TYP = OCDASGN.OFC_TYPLEFT JOIN OfficeAddressInformation ON FO.OCD =OfficeAddressInformation.OCDLEFT JOIN OfficePhones ON FO.OCD = OfficePhones.OfficeCodeLEFT JOIN RONew as RO ON FO.ROCD = RO.OCDLEFT JOIN AREANew as AREA ON FO.ADOCD = AREA.OCD |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2002-03-22 : 13:56:48
|
| iif() isn't a t-sql function; you could use a CASE statement there though.setBasedIsTheTruepath<O> |
 |
|
|
|
|
|
|
|