Link to home
Start Free TrialLog in
Avatar of sfun28
sfun28

asked on

SQL view with If...Then...Else for Column

Folks,

Lets say I have the following table:
OriginalDate   NewDate  GoodData Value
1/1/2008        2/2/2008    1                109
1/2/2008        3/3/2008    0                401

I want to create a view with 2 columns: Date, Value
If GoodData = 1, I want Date to show OriginalDate
if GoodData =0, I want Date to show NewDate

so SELECT * FROM View1 would return
Date         Value1
1/1/2008   109
3/3/2009   401
ASKER CERTIFIED SOLUTION
Avatar of BrandonGalderisi
BrandonGalderisi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sfun28
sfun28

ASKER

thanks!!!