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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER