Calyx Teren
asked on
Debug "Incorrect syntax near 'FileType'Col"
The first section works fine, but after that, I get an error in this section below. The equals sign looks like it's highlighted. I need to add many more SET statements. How do i avoid the error?
set [FileTypeCol] = 'File Type2'
use [database]
update table
set [FileTypeCol] = 'File Type1'
from table
where [FileTitle] like '%FileType1%'
or [Content Title] like '%file-type1%'
or [Content Title] like '%file Type 1%'
or [Content Title] like '%File_Type1%'
set [FileTypeCol] = 'File Type2'
from table
where [FileTitle] like '%filetyp2%'
or [Content Title] like '%file_type2%'
set [FileType] = 'File Type 3'
from table
where [FileTypeCol] like '%filetype3%'
or [Content Title] like '%FileType3%'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>Debug "Incorrect syntax near 'FileType'Col"
>How do i avoid the error?
Also in the future when you copy-paste a code block where the error occured, tell us the line number of the error, making sure that it translates to the EE code block numbers.
>How do i avoid the error?
Also in the future when you copy-paste a code block where the error occured, tell us the line number of the error, making sure that it translates to the EE code block numbers.
ASKER
I believe there was a copy-paste error when the admin added my code to the code block. My original code goes from line 3 to line 21. That said, thank you for the feedback. Lots of helpful information. Jim, the code worked after I made the changes you recommended. Thanks!
Thanks for the grade. Good luck with your code. -Jim
Bye, Olaf.