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 |
Cooperrud
Starting Member
1 Post |
Posted - 2015-03-23 : 14:09:50
|
So, I am stumped on how this would work. Not sure if a 'case if' is necessary or not. But essentially, I have a column that contains the values A or B and another column that contains a "status date" an a third and final column that contains "established date". In my output, I need the "status date" if my value is A, and if my value is B I need the "established date". I've tried a case if, but I don't think I'm doing it right. Any Ideas?Thanks in advance! |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2015-03-23 : 14:14:45
|
SELECT SomeAlias = CASE WHEN acolumn = 'A' THEN AnotherColumn WHEN acolumn = 'B' THEN FinalColumn END...Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|