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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSRS error when evaluating for nulls

Status
Not open for further replies.

jpeters01

Technical User
Joined
Dec 5, 2007
Messages
109
Location
US
This formula works unless both the DOSESTRENGTH and DOSE_AMOUNT fields are empty and then it returns #Error. The error occurred after we added the statement to remove the trailing decimals but I don't know how to correct it...any ideas?

=IIF (IsNothing(Fields!DOSESTRENGTH.Value),
IIF (IsNothing(Fields!DOSE_AMOUNT.Value) OR LEN(CStr(Fields!DOSE_AMOUNT.Value)) = 0 OR CStr(Fields!DOSE_AMOUNT.Value) = "",
"",
IIF (CStr(Fields!DOSE_AMOUNT.Value) LIKE "*.*0",
Mid(Cstr(Fields!DOSE_AMOUNT.Value), 1, LEN(Cstr(Fields!DOSE_AMOUNT.Value))-1) & "-" & CStr(Fields!DOSE_UNIT_DESC.Value),
CStr(Fields!DOSE_AMOUNT.Value) & "-" & CStr(Fields!DOSE_UNIT_DESC.Value))),
Fields!DOSESTRENGTH.Value)
 
Try changing your 'OR' keywords to their short-circuit equivalent 'OrElse'.
 
Dave...thanks we will give this a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top