Adding dates

hrov

Registered User.
Local time
Today, 07:52
Joined
Feb 18, 2009
Messages
52
In my query i have a field that is titled "date_achieved", and another that is titled expires_(months).

for example the date_achieved field may hold 01/01/2020. The
expires_(months) may hold 24 months.

I have made a new field (an expression) that is supposed to give the date of the expiration. In this case it should return 01/01/2022.


I have been trying to work with this frame:
DateAdd("m", 24, "01/01/2020")

But the date and value of moths could change so i need to allow for this. This is what I have come up with:

DateAdd("m",[expires_(months)],"[date_achieved]")

But it doesnt work. Can someone help me please :o
 
You don't want quotes around the field name.
 
You don't want quotes around the field name.
DateAdd("m",[expires_(months)],[date_achieved])

doesnt work either, i get a box asking for expiresdate (the new field) where the expression is going.

I was thinking that it could have something to do with the format being short date?
 
A parameter prompt would indicate that the field name is misspelled or that field isn't in the table being queried.
 
A parameter prompt would indicate that the field name is misspelled or that field isn't in the table being queried.
ok thanks thats sorted.

Now what i need for another query's criteria is :
To show dates that are one month or less away from todays date.
 
That's open to some interpretation, but this should give you the tools necessary:

Between DateAdd("m", -1, Date()) And DateAdd("m", 1, Date())
 
That's open to some interpretation, but this should give you the tools necessary:

Between DateAdd("m", -1, Date()) And DateAdd("m", 1, Date())

Thank You pbaldy
 

Users who are viewing this thread

Back
Top Bottom