Count records that meet criteria

Dimples

Registered User.
Local time
Today, 18:01
Joined
Aug 19, 2005
Messages
15
I want to put a box on a report that will display the items that are 30 over due. For instance the date of the item is stored in a table in a field called [DateofRecord]. so I want to count the records that a query for a report returns if the [DateofRecord]+30 > today AND if [Status]="In Progress".

What is wrong with this statement:
=Sum(IIf([Status]="In Progress" AND ([DateofRecord]+30)>Today,1,0))


TIA
 
=Sum(IIf([Status]="In Progress" AND ([DateofRecord]+30)>Today,1,0))
I don't think Today's a valid identifier try
=Sum(IIf([Status]="In Progress" AND ([DateofRecord]+30)>Date,1,0))
 
Ok, that didnt work. :eek:

it is telling me the expression is either incorrect or too complex. Any ideas?

TIA!
 
Date() is the correct format to return today's date in a query, you can also use Now() which returns not only today's date but also the exact time the query is executed.

That should do it for you, otherwise you need to get into a slightly more complex method of adding 30 days to the date you are testing. where you would use DateAdd("d",30,[DateofRecord]) to add 30 days.
 

Users who are viewing this thread

Back
Top Bottom