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 |
dabooj
Starting Member
7 Posts |
Posted - 2010-04-09 : 10:02:21
|
Hi guys,I have a query in one of my reporting services reports which is based on a case statement that uses a wildcard. (e.g. HAVING DIRECTORATE_CODE LIKE CASE WHEN @Directorate = 'ALL' THEN '%%' ELSE @Directorate END).This code is supposed to show all records for directorate when the 'ALL' option is selected from the report filter combo box. This works fine BUT it is currently excluding null values. I'm assuming that the % wildcard ignores nulls.Is there anyway i can get the case statement (or more specifically the 'THEN' statement) to show all records including the null values when 'ALL' is seleceted?Regards,ShujaShuja AhmadSystems Developer |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-04-09 : 10:38:39
|
Can you post the full code?Try thisHAVING (@Directorate ='ALL' or DIRECTORATE_CODE = @Directorate)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|