Date Query

F

Fae McCrackren

I always have trouble with date fields. I realize it is a pretty simple
query, but could someone give me (a generic) expression to calculate what a
date would be from another date. i.e. field is "declaration date"and I want
to show the a date that is 48 months from the "declaration date". Right now
I just use [Declaration Date]+365*4+1
 
J

Jerry Whittle

DateAdd("yyyy", 4, [Declaration Date])

yyyy is Year. 4 is the number of Years.
 
J

John W. Vinson

I always have trouble with date fields. I realize it is a pretty simple
query, but could someone give me (a generic) expression to calculate what a
date would be from another date. i.e. field is "declaration date"and I want
to show the a date that is 48 months from the "declaration date". Right now
I just use [Declaration Date]+365*4+1

Use the DateAdd() function. Type Ctrl-G to open the VBA editor (to get the
right help file) and search for help on DateAdd. You could use either

DateAdd("yyyy", 4, [Declaration Date])

to add four calendar years, or

DateAdd("m", 48, [Declaration Date])

to add 48 months.
 

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