March 19, 2009 at 9:26 am
In SSRS, I have an expression like the following:
Iif(FlagCol = "Flag","",AmtCol)
Here I am returning a blank cell when the Flag column contains the word Flag, otherwise, I am bringing back a numeric amount.
This works great...until I export the results to Excel. When exporting to Excel, the amount column is displayed as Text. I need it as numeric.
I can get around this by changing my expression to the following:
CDec(Iif(FlagCol = "Flag",0,AmtCol))
Doing it this way, the column in excel is numeric. This is good. However, the problem is, my users want a Blank and not a Zero in the cell when the flag is there.
I thought that I would attempt to return a NULL and see if this works.
Sorry for such a long explanation, but Can I return a NULL value in SSRS?
March 19, 2009 at 10:07 am
Try this (no guarantees):
Iif(FlagCol = "Flag",Nothing,AmtCol)
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
March 19, 2009 at 10:14 am
That works perfectly. So easy, that the question now seems even more silly. LOL
Thank you, Jack!
March 19, 2009 at 10:20 am
hughesj23 (3/19/2009)
That works perfectly. So easy, that the question now seems even more silly. LOLThank you, Jack!
No problem. And a question only seems silly once you know the answer.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply