Problems altering a complex SQL code, always get an error

Hello,

Will be a mircale if someone could help with this one, been driving me crazy all afternoon. I'm trying to extend someones SQL code who has now left the business. I have attached the script to the thread in notepad. The problem I have is if I change the smallest thing like the output in an iif statement I get an error message which I have attached. Even if I put the script back to how it was and try and run it again I still get the same error message.

Does anyone know why it is happening? not expecting you to know what the script is fully doing just how I can correct the error or avoid it.

Finishing work now but back 8am GMT time, would be great is anyone has any ideas

Thanks
Ian
SQL.txt
error.JPG
ShockUKAsked:
Who is Participating?
 
mikainzConnect With a Mentor Commented:
Hi please
replace the brackets [ and ]
with the following brackets ( and )

see attached file
sql2.txt
0
 
ShockUKAuthor Commented:
So simple but so great.
I would give you more than 500 points if I could for this

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.