Hi expert,
May i know how to use apply IF..ELSE statement into Select query'
For example:
Select A,B,(If (C like '') D ELSE E) as F, G
From XBN
I test out the example, i got error msg on it "Incorrect syntax near the
keyword "IF".
Please adivce on how to accomplish above example.
thank you in advance.
Ocurnos."Daniel" <Daniel@.discussions.microsoft.com> wrote in message
news:1C17E682-946F-42F9-87A2-BFD4A2586AA1@.microsoft.com...
> Hi expert,
> May i know how to use apply IF..ELSE statement into Select query'
> For example:
> Select A,B,(If (C like '') D ELSE E) as F, G
> From XBN
> I test out the example, i got error msg on it "Incorrect syntax near the
> keyword "IF".
> Please adivce on how to accomplish above example.
> thank you in advance.
> Ocurnos.
Look up CASE in books on-line.
Select A, B, CASE WHEN C = '' THEN D ELSE E END as F, G
From XBN|||Thanks Raymond.
"Raymond D'Anjou" wrote:
> "Daniel" <Daniel@.discussions.microsoft.com> wrote in message
> news:1C17E682-946F-42F9-87A2-BFD4A2586AA1@.microsoft.com...
> Look up CASE in books on-line.
> Select A, B, CASE WHEN C = '' THEN D ELSE E END as F, G
> From XBN
>
>
No comments:
Post a Comment