Date Field

G

Guest

I am using Access 2003

I am trying to develop a preventative maintenance database for all of our
plant machines. In my database, I have a query for a form with a calculated
date (DateDue) field. It takes the previous "PM date" and adds the
"frequency" to it and comes up with the next PM Date Due. When I add the
following to the query criteria for this field - "Between [Enter Beg Date]
and [Enter End Date]" - I get no response. But when I add - ">#7/1/06# and
<#8/1/06#" I get all of the correct records. Does anyone have any idea why
my "between" statement is not working????

I looked on MS for a template for this type of database but couldn't find one.
Does anyone know where I could get a template for a Preventative Maintenance
Program?

I would appreciate any help you can give me - Aurora
 
G

Guest

Hi Aurora

To get the days between your dates use -
=DateDiff("d", [StartDate], [End])

Note it would be a good idea to create a field (as in my sample) called
[frequency] into which you would add data (a number) to show the number of
days between PMDate and due date.


To get the next required PM Due date use -
DueDate:DateAdd("d", +[Frequeny], [PMDate])



Or

DueDate:DateAdd("m", 1, [PMDate) is 1 month after the PMDate
DueDate:DateAdd("m", 2, [PMDate) is 2 month after the PMDate
etc.


Hope this helps
 

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

Similar Threads


Top