Calculate days using 2 arguments

athikah

New member
Local time
Today, 10:40
Joined
Dec 19, 2012
Messages
2
Hi all. I am new here.

I have a database to monitor incoming emails from our contractor & my superior wants it to have control like the following situations:
1. If no respond yet, to calculate today's date minus received date
2. If responded, to calculate respond date minus received date

If i use the following expression, it does not relate to if the emails have no respond yet or have been responded.

IIf(IsNull([Reply Date]),DateDiff("d",[Due Date], Now()))

Can somebody help me.
 
If I rewrite your condition in the form of

IF something then
Do this
ELSE
Do this

Then your statement says
IIf(
IsNull([Reply Date]), THEN
DateDiff("d",[Due Date], Now())
ELSE

)
 
You do not have the correct syntax for IIF.



You will have to sort out which fields represent what in your table(s) and construct your query accordingly.

ok thanks. hopefully i can understand more on the Iif function.
 
IIF (some condition, condition is true, condition is False)

3 parts
condition -- something that evaluates to True or False
condition is TRUE -- what to do when condition is True
condition is FALSE -- what to do when condition is False

You DO NOT HAVE the condition is FALSE construct in your IIF
 
Last edited:

Users who are viewing this thread

Back
Top Bottom