Re: find orders 90 days past due

Tech-Archive recommends: Fix windows errors by optimizing your registry



Did you add your date field into the design grid a second time?
Did you put the criteria into a criteria "cell" under the second instance of the date field.

Field: [Your Date Field]
Table: [Your table Name]
Criteria: < DateAdd("d",-89,Date())

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

eddieK wrote:
the first methow worked great!. however, i messed up the second instruction. When entered with the <dateadd, i received an error message 'expression contains invalid data". i am using DueDate field to store dates and used 9/1/2009.

If i remove the < then the query runs, but shows a date of of 9/26/2009 in the calculation field.

Thank you for your help.

"John Spencer" wrote:

Use an expression like:
IIF(Date()-[SomeDateField]>=90,"Yes",Null)

And if you are talking about limiting the records to just those over or = to 90 day. Add the datefield into your query (again if needed) and set the criteria to
<DateAdd("d",-89,Date())

That will only return records where your field is over 90 days from today.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

eddieK wrote:
John:
tku for the quick reply. I was able to run the quert successfully. However is there a way to only show the records that are >90 days, rather that displaying all records90)records. Also, instead of showing -1 in the calculated field, can yes be displayed.
"John Spencer" wrote:

You can use an expression like the following to calculate in a query the number of days overdue.

Date()-[SomeDateField]>=90
Date()-[SomeDateField]>=60 AND Date()-[SomeDateField]<90
Date()-[SomeDateField]>=30 AND Date()-[SomeDateField]<60

That will return true or false. If you want the True/False to appear in as a value in a query and you are using the design view to build the query, you would enter something like the following to return -1 (90 Days overdue), Not 90 days overdue.

Field: Over90: Date()-[SomeDateField]>=90

If you want to do that in one field, then you would need and expression like the following. All on one line, but entered here with line feeds to make it easier to read.
IIF(Date()-[SomeDateField]>=90, "OverDue 90",
IIF(Date()-[SomeDateField]>=60 AND Date()-[SomeDateField]<90,"Overdue 60",
IIF(Date()-[SomeDateField]>=30 AND Date()-[SomeDateField]<60,"OverDue 30",
"Current")))

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

eddieK wrote:
Want to create query showing orders 30 60 90 days overdue. would like to calculate these dates without vba....tku 2003 or 2007
.



Relevant Pages

  • Re: Using If expressions with an Or expression, and a Count questi
    ... The addition of the commas inside the was to ensure exact matches to Bill and Steve and preclude a record with STE being returned. ... "John Spencer" wrote: ... You did not give us any table or field names so what I wrote was a generic example of a query. ... To do this in design view, you would put the IIF statement into a field "box" and the Like into a criteria box under the IIF. ...
    (microsoft.public.access.queries)
  • Re: Narrowing query results
    ... It should return ALL items that match criteria unless you enter criteria on the outer query. ... controlname is the Name property of the control ... John Spencer wrote: ...
    (microsoft.public.access.queries)
  • Re: searching for similar records
    ... "John Spencer" wrote: ... anything at all with criteria or joins on partnumber. ... should only the partnumber and customer be ... Open a new query ...
    (microsoft.public.access.queries)
  • Re: Query w/Date & Time in Same Field
    ... John Spencer ... Access MVP 2002-2005, 2007 ... and then did you apply the criteria against this calculated field? ... My table I am using with this query has several ...
    (microsoft.public.access.queries)
  • Re: Isolate Patterns
    ... Your script was exactly was I've been looking for... ... "John Spencer" wrote: ... Do you want someone to write the SQL for the query? ... using the like criteria versus using criteria on just the stripped result. ...
    (microsoft.public.access.queries)