SQLTeam.com | Weblogs | Forums

'incorrect syntax' in CAST statement


#1

What's incorrect?
I get Msg 1035, Level 15, State 10, Line 41
Incorrect syntax near 'cast', expected 'AS'.

My code:
CAST(#temp.[TotalClaimsWorked] as varchar(5)) + ltrim(rtrim(cast(#temp.[opid]) as varchar(10)))) + CONVERT(varchar(8),#temp.[ChangeDate],112) + 'PHP' as 'ChangeUserAndDate',


#2
CAST(#temp.[TotalClaimsWorked] as varchar(5)) + ltrim(rtrim(cast(#temp.[opid]) as varchar(10)))) + CONVERT(varchar(8),#temp.[ChangeDate],112) + 'PHP' as 'ChangeUserAndDate',

Extra right parenthesis after varchar(10) I think


#3

There did turn out to be some parenthesis issues after all, thanks! all set now.