Find records with date more than xx months

J

James

Assume we have a table listing serial number (of a widget) and a date.

The date is the date of service.

How can we then, produce a query/report listing all widgets that have not
been services within the last 12 months?

Are we approching this wrongs? Should we have a fixed field showing date
next service due? How can this be calculated from the data in the table?
 
D

Douglas J Steele

Create a query based on that table, and add a calculated field to the query.
Your calculation would be something like:

MonthsSinceLastService: DateDiff("m", [LastServiceDate], Date())

Put > 12 as the criteria under that field.
 
E

Ed Warren

You will want to use the datadiff function

MonthsSinceService: datediff("m",[lastservice],now())
then select records with a MonthsSinceService >=12

Ed Warren
 
R

rico

Calculated fields is the way to do. All you need is a text box or row in
query with source something thing like:

=[Datefield]+365

Then you can run querys on this field, call it [nextservice] like:

Where [Nextservice]<Date()

This will return all widgets past thier service date.

HTH

Rico
 
Top