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 |
chipembele
Posting Yak Master
106 Posts |
Posted - 2008-01-21 : 05:51:38
|
HiI've got the following(CASE WHEN [Code] = 'WBWFT' OR [Code] = 'WBPLAS' THEN 'Friday 7th March 2008 from 9:30am to 3:30pm. ' ELSE ' Thursday 6th March 2008 from 10:00am to 1:00pm. ' END)I need to change the above statement as the parameters have changed to something like this but am struggling with the ELSE. Do I need ELSE IF?This is what I need it to do.WHEN the Code is 'WBFT' OR the code is 'WBPLAS' then Friday 7th March from 9:30am to 3:30pmELSEWHEN the Code is 'WBPLMB' then Thursday 6th March 2008 from 10:00am to 1:00pm.ELSEWHEN the Code is 'WBCJ' then Wednesday 5th March 2008 from 10:00am to 3:00pm. Can anyone help me please?ThanksDan |
|
sunil
Constraint Violating Yak Guru
282 Posts |
Posted - 2008-01-21 : 05:58:02
|
Try using followingCASE WHEN [Code] = 'WBWFT' OR [Code] = 'WBPLAS' THEN 'Friday 7th March 2008 from 9:30am to 3:30pm. 'WHEN [Code] = 'WBPLMB' THEN 'Thursday 6th March 2008 from 10:00am to 1:00pm 'WHEN [Code]='WBCJ' THEN 'Wednesday 5th March 2008 from 10:00am to 3:00pm'END |
 |
|
chipembele
Posting Yak Master
106 Posts |
Posted - 2008-01-21 : 06:20:28
|
Thankyou SunilDidnt realise it was as simple as that. RegardsDaniel |
 |
|
|
|
|