geraldjr30
Starting Member
5 Posts |
Posted - 2014-06-11 : 13:08:12
|
hi. getting the following error message:Msg 156, Level 15, State 1, Line 123Incorrect syntax near the keyword 'is'.Msg 319, Level 15, State 1, Line 143Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.Msg 319, Level 15, State 1, Line 144Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.Msg 319, Level 15, State 1, Line 146Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.using this syntax:...,casewhenLEFT(LTRIM(SubString(ltrim(rtrim(rms.nm12)),CHARINDEX(' ', ltrim(rtrim(rms.nm12)))+1,len(ltrim(rtrim(rms.nm12))) - CHARINDEX(' ', ltrim(rtrim(rms.nm12))))), CHARINDEX(' ', LTRIM(SubString(ltrim(rtrim(rms.nm12)),CHARINDEX(' ', ltrim(rtrim(rms.nm12)))+1,len(ltrim(rtrim(rms.nm12))) - CHARINDEX(' ', ltrim(rtrim(rms.nm12))))))) is nullandright(LTRIM(SubString(ltrim(rtrim(rms.nm12)),CHARINDEX(' ', ltrim(rtrim(rms.nm12)))+1,len(rms.nm12) - CHARINDEX(' ', ltrim(rtrim(rms.nm12))))), --FIRST TEMPlen(LTRIM(SubString(ltrim(rtrim(rms.nm12)),CHARINDEX(' ', ltrim(rtrim(rms.nm12)))+1,len(ltrim(rtrim(rms.nm12))) - CHARINDEX(' ', ltrim(rtrim(rms.nm12)))))) -CHARINDEX(' ', LTRIM(SubString(rms.nm12,CHARINDEX(' ', ltrim(rtrim(rms.nm12)))+1,len(ltrim(rtrim(rms.nm12))) - CHARINDEX(' ', ltrim(rtrim(rms.nm12))))))is not nullthen ''else right(LTRIM(SubString(ltrim(rtrim(rms.nm12)),CHARINDEX(' ', ltrim(rtrim(rms.nm12)))+1,len(rms.nm12) - CHARINDEX(' ', ltrim(rtrim(rms.nm12))))), --FIRST TEMPlen(LTRIM(SubString(ltrim(rtrim(rms.nm12)),CHARINDEX(' ', ltrim(rtrim(rms.nm12)))+1,len(ltrim(rtrim(rms.nm12))) - CHARINDEX(' ', ltrim(rtrim(rms.nm12)))))) -CHARINDEX(' ', LTRIM(SubString(rms.nm12,CHARINDEX(' ', ltrim(rtrim(rms.nm12)))+1,len(ltrim(rtrim(rms.nm12))) - CHARINDEX(' ', ltrim(rtrim(rms.nm12))))))end as middletestcan someone please help me correct the case statement?thanks in advance |
|