Expression to calculate elapsed time, using IIF

I

Igor

Hello, everybody,

Perhaps someone here can help me out a little bit.

I need an expression that calculates the elapsed time between the date a
letter was sent and, either, the date we received the reply (in case the
Reply field is populated), or, today's date (in case we haven't received a
reply and thus the Reply field is blank).

I've tried using the following formula but it only shows the difference
between the date the letter was sent and the date the reply was received:

IIf(IsEmpty([To 3P]![3P Reference Number]),DateDiff("d",[To 3P]![Date
Sent],Date()),DateDiff("d",[To 3P]![Date Sent],[From 3P]![Date received]))

The field 3P Reference Number (in the To 3P table) is the reply field.The
reply date is in the table To 3P and the link field is the 3P Reference
Number.

Thank you in advanced for your help!
 
D

Dale Fye

How about:

Elapsed Time: datediff("d", [Date Sent], NZ([Date Received], Date())

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
I

Igor

Perfect!!!

Thank you very much!!!

--

igor


Dale Fye said:
How about:

Elapsed Time: datediff("d", [Date Sent], NZ([Date Received], Date())

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



Igor said:
Hello, everybody,

Perhaps someone here can help me out a little bit.

I need an expression that calculates the elapsed time between the date a
letter was sent and, either, the date we received the reply (in case the
Reply field is populated), or, today's date (in case we haven't received a
reply and thus the Reply field is blank).

I've tried using the following formula but it only shows the difference
between the date the letter was sent and the date the reply was received:

IIf(IsEmpty([To 3P]![3P Reference Number]),DateDiff("d",[To 3P]![Date
Sent],Date()),DateDiff("d",[To 3P]![Date Sent],[From 3P]![Date received]))

The field 3P Reference Number (in the To 3P table) is the reply field.The
reply date is in the table To 3P and the link field is the 3P Reference
Number.

Thank you in advanced for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top