Creating New Date Field In Query

LeoDee

Registered User.
Local time
Today, 14:00
Joined
Dec 4, 2002
Messages
31
Hi Folks...

I have been browsing this wonderful site for a couple of weeks and have gotten tons of helpful information. But now I am stuck.
I have some knowledge of ACCESS but minimal VB smarts. I am self teaching myself as I (as a non-paid volunteer) build a membership data base application. In simplist terms, here is what I would like to do.

Within a query I have a RENEWAL DATE. I would like to take this date, add one year to it and create a new field that reflects only the new month and year. For example, if RENEWAL DATE is 23 October 2001, my new field should contain October 2002. I want to pass this field to Word along with name and address info for a mail merge application.

If this involves VB, please tell me where to enter the code. I have no problems figuring this out with Forms but doing anything beyond the basic with Queries seems above me.

Thanks for helping....
 
With your query in design mode, place the following in the
first blank field: NextYear: Format(DateAdd("yyyy",1,[MyDate]),"mmm yyyy")
Sample SQL would look like:
Code:
SELECT tblMyDate.MyDate, Format(DateAdd("yyyy",1,[MyDate]),"mmm yyyy")
AS nextYear FROM tblMyDate;
Just substitute your table.field for tblMyDate.MyDate.
 
In a form: Create an Unbound Control and in it's Control Source, put:

=Format(DateAdd("yyyy",1,[RENEWAL DATE]),"MMMM YYYY")

or in a blank column in your query put:

New Date: Format(DateAdd("yyyy",1,[RENEWAL DATE]),"MMMM YYYY")

That should do it!
 
Thanks to both for reply. Works as advertised!:D
 

Users who are viewing this thread

Back
Top Bottom