Select
Col1, Col2,
Col3=Case When Col1>=Col2 Then 1 Else -1 End
From TblName Terry L. Broadbent FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
No you can't use the CASE statment in that manner. You should write the query in the following manner.
Select
a.Col1, a.Col2,ca.Col3,
b.Col1 As Col1b
From TblName Inner Join TblName2
On a.keycol=b.keycol2
Where (a.Col1=1 And <other criteria>)
Or (a.col1<>1 And <another criteria>)
Terry L. Broadbent FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.