Is Null or Is Not Null

frenzied_female

Registered User.
Local time
Tomorrow, 00:41
Joined
Aug 24, 2016
Messages
10
Hi Everyone,

I am trying to calculate the number of weeks open by using a parameter query. I would also like to include in the query the option to use the finalised date to calculate the number of weeks the ticket took to complete.

To calculate the number of weeks open I have used this parameter, which works well:
=IIf(IsNull([Finalised Date]),DateDiff("ww",[Opened Date],Now()))

I then need to add in if the finalised date is not null to calculate the overall number of weeks the ticket was open, i tried this:
=IIf(IsNull([Finalised Date]),DateDiff("ww",[Opened Date],Now())) Or (IsNotNull([Finalised Date]),DateDiff("ww",[Finalised Date],[Opened Date]))

But the result shows as: #Name?

Could somebody please show me where i am going wrong, i have no idea what to do.

Many thanks,
Kim
:banghead:
 
There is no such function as IsNotNull()...
Code:
=IIf(IsNull([Finalised Date]),DateDiff("ww",[Opened Date],Now())) Or ([COLOR="Red"]IsNotNull[/COLOR]([Finalised Date]),DateDiff("ww",[Finalised Date],[Opened Date]))
hth
Mark
 
I think the extra code forms the Else part of the IIf code
Try this

Code:
=IIf(IsNull([Finalised Date]),DateDiff("ww",[Opened Date],Now()), DateDiff("ww",[Finalised Date],[Opened Date]))
 
Thank you both so much for your fast replies!

Fixed my issue perfectly, i only had to swap the order of the opened date and finalised date that i had around the wrong way so that i didn't get a negative number result.

You guys are the best!

:D
 
And if it ever comes up, the logical negation is NOT ([Finalized Date] Is Null)
 

Users who are viewing this thread

Back
Top Bottom