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 |
Jannette
Starting Member
26 Posts |
Posted - 2011-08-31 : 09:03:49
|
I have written the following CASE syntax, but it is giving an error,Can you help please?=================================================================== CaseWhen (CANDIDATE.Branch_Id=2 and CANDIDATE.Division_Id<>2) Then '"OSS"' When (CANDIDATE.Branch_Id=2 and CANDIDATE.Division_Id=2) Then '"OES"'When (CANDIDATE.Branch_Id=3 and CANDIDATE.Division_Id=27) Then '"RPO"'When (CANDIDATE.Branch_Id=3 and CANDIDATE.Division_Id In (7,15) Then '"OWB"' Else '"???"' End as Division,=================================================================== |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-08-31 : 09:09:56
|
[code]CaseWhen (CANDIDATE.Branch_Id=2 and CANDIDATE.Division_Id<>2) Then '"OSS"' When (CANDIDATE.Branch_Id=2 and CANDIDATE.Division_Id=2) Then '"OES"'When (CANDIDATE.Branch_Id=3 and CANDIDATE.Division_Id=27) Then '"RPO"'When (CANDIDATE.Branch_Id=3 and CANDIDATE.Division_Id In (7,15)) Then '"OWB"' Else '"???"' End as Division[/code]you missed a )------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
Jannette
Starting Member
26 Posts |
Posted - 2011-08-31 : 09:21:10
|
Thankyou, silly me.Time for a coffee break I think. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-08-31 : 10:13:33
|
wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|