Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

evaluate null dates SSRS

Status
Not open for further replies.

lisat76

Programmer
Sep 25, 2007
89
0
0
US
i have this expression
Code:
=IIF (DatePart("y",Fields!GtCalcDate.Value)   304), (DateAdd  ("H", -1, Fields!FirstCall.Value)),(Fields!FirstCall.Value))

that works just fine if the date field gtcalcdate is not null if it is null the field just displays #Error.
I know why it can't make a calculation on a null field. I tried to add is not nothing to this but it did not help.

I either want to add gtcalcdate is not nothing to this so if the date field is null it does not evaluate it, or change the visibility to false if i get an error.



Thanks
 
Can you not prevent the null in the first place by using

idnull(Datefield,'N/A') or similar in your SQL - that way you just need to test for 'N/A' in the function before proceeding with the date calc...

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top