calculate difference between dates

S

SylvieB

Hello group
On a report, i need to calculate the aging days between today's date and
award date but only if today's date is greater than award date.
Here what i have so far. I don't know how to filter it only if today's date
awarddate.
=dateDiff("d",[awarddate], Now())

Thank you in advance for any help.
Sylvie
 
K

KARL DEWEY

IIF(Date() > [awarddate], dateDiff("d",[awarddate], Date()), "")

--
Build a little, test a little.


SylvieB said:
Hello group
On a report, i need to calculate the aging days between today's date and
award date but only if today's date is greater than award date.
Here what i have so far. I don't know how to filter it only if today's date
awarddate.
=dateDiff("d",[awarddate], Now())

Thank you in advance for any help.
Sylvie
 
W

Wayne-I-M

IIf([TableName]![AwardDate]<Date(),DateDiff("d",[TableName]![AwardDate],Date()))

IIf([TableName]![AwardDate]>Date(),DateDiff("d",[TableName]![AwardDate],Date()))


Not sure what you looking for - one of them is correct
either award before or after today


--
Wayne
Manchester, England.



SylvieB said:
Hello group
On a report, i need to calculate the aging days between today's date and
award date but only if today's date is greater than award date.
Here what i have so far. I don't know how to filter it only if today's date
awarddate.
=dateDiff("d",[awarddate], Now())

Thank you in advance for any help.
Sylvie
 
J

Jerry Whittle

IIf([awarddate] < Now(),DateDiff("d",[awarddate], Now()),0)

This will return a 0 if the awarddate is greater than Now. You could change
the 0 to Null.

Now if you just want those records returned at all, you could put >0 in the
critieria of a field like below:

AwardCalc: DateDiff("d",[awarddate], Now())
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


SylvieB said:
Hello group
On a report, i need to calculate the aging days between today's date and
award date but only if today's date is greater than award date.
Here what i have so far. I don't know how to filter it only if today's date
awarddate.
=dateDiff("d",[awarddate], Now())

Thank you in advance for any help.
Sylvie
 
S

SylvieB

Thank you ALL very much. It works great.

Jerry Whittle said:
IIf([awarddate] < Now(),DateDiff("d",[awarddate], Now()),0)

This will return a 0 if the awarddate is greater than Now. You could change
the 0 to Null.

Now if you just want those records returned at all, you could put >0 in the
critieria of a field like below:

AwardCalc: DateDiff("d",[awarddate], Now())
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


SylvieB said:
Hello group
On a report, i need to calculate the aging days between today's date and
award date but only if today's date is greater than award date.
Here what i have so far. I don't know how to filter it only if today's date
awarddate.
=dateDiff("d",[awarddate], Now())

Thank you in advance for any help.
Sylvie
 
W

Wayne-I-M

I take it from the lack of a tick that you didn't like my answer. OK.

But if your report is based on a query (which I assume it is) then you would
be better placing the calculation in the query and using the results in the
report.

we can but try to help ?


--
Wayne
Manchester, England.



SylvieB said:
Thank you ALL very much. It works great.

Jerry Whittle said:
IIf([awarddate] < Now(),DateDiff("d",[awarddate], Now()),0)

This will return a 0 if the awarddate is greater than Now. You could change
the 0 to Null.

Now if you just want those records returned at all, you could put >0 in the
critieria of a field like below:

AwardCalc: DateDiff("d",[awarddate], Now())
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


SylvieB said:
Hello group
On a report, i need to calculate the aging days between today's date and
award date but only if today's date is greater than award date.
Here what i have so far. I don't know how to filter it only if today's date
awarddate.
=dateDiff("d",[awarddate], Now())

Thank you in advance for any help.
Sylvie
 

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