Projecting Date

M

Michelle

I have a query that pulls data based on either a 3 or 5 year cycle what I
need is to add a field to the query called replacement date. This would be
the purchase date + 3 years for the 3 year cycle or + 5 years for the 5 year
cycle they are each in their own query so would not have to have both in one.
Here is an example of what I am looing for say I run the 3 year cycle query
and I get back the follwoing:
Purchase Date: 06/06/06
I would want a field added that would say:
Replacement Date: 06/06/09
 
K

Klatuu

In your query builder:

ReplacementDate: DateAdd("yyyy", 3, [PurchaseDate])

and 5 for the other query.

But, why have two queries when you can have one? Assuming you have a field
that defines the cycle and it has a value of either 3 or 5:

ReplacementDate: DateAdd("yyyy", [cycle], [PurchaseDate])
 
K

KARL DEWEY

Put this in the query Field row of the grid.
Replacement Date: Datadd("yyyy", 3, [Purchase Date])

A better way is to have a number field named ReplaceCycle in your equipment
table --
Replacement Date: Datadd("yyyy", [ReplaceCycle], [Purchase Date])
 

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