#Error when getting value

SmartestIdiot

New member
Local time
Today, 11:18
Joined
Dec 10, 2013
Messages
4
I have a problem getting the value of an IIF function that produces a DateDiff. Instead I'm getting numbers stored as text, and when I try to sort the report, the numbers are all over the place.

I tried the Val function on the DateDiff, but this only produce #Errors in certain fields. That's because not records have a date in them.

The field is suppose to produce a countdown of days until the report is late, but only if the Received_Date is blank. Otherwise nothing. Also not everyone has a Duedate, that's whats causing the #Error.

Original report that produces numbers as text.

Late_Report: IIf(IsNull([Received_Date]),DateDiff("d",[Due_Date],Date()-14),"")

Attempt to get values which produces #Error

Late_S1: IIf(IsNull([STATUS_DT]),Val(DateDiff("d",[CURRENT_THRU],Date())-14),"")

I was thinking of just producing another query and working off of that instead. I would like to know the answer though, if there is one. Thanks.
 
Set the outcome of the null status date to be a number, 0?
 
I produced a query in the end and got the results I needed.
 

Users who are viewing this thread

Back
Top Bottom