dbTalk Databases Forums  

Newbie Question

comp.database.ms-access comp.database.ms-access


Discuss Newbie Question in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Feeley
 
Posts: n/a

Default Newbie Question - 05-25-2005 , 07:27 PM






I am tring to add a number of years to a dob. im doing this by adding my
date+years*365.26 I get a string of numbers. I then convert the number in
the next column to actual date again. I'm getting the correct date. Now I
want my criteria on that column to allow me to return only date in a given
to from period of my choosing. I try the between_and functions but nothing
is returned. I'm guessing it's because the column is still a calculation and
not a true date.

I've tried the make table query and running another query from that and
trying a seperate query from my original query. I can't seem to make this
happed. Is ther an easier way to:

Add a number of years to a date and have it reurn a date and not the number
string?
If not is there a better way to convert the string to a date?
Is there a way to get my criteria to recognize the date and return date
between my begin and end dates?

Sorry that this is so basic, I can;t find anything in the three books I've
bought that helps me understand this.

Thanks

John



Reply With Quote
  #2  
Old   
Bob
 
Posts: n/a

Default Re: Newbie Question - 05-26-2005 , 08:58 PM






John Feeley wrote:
Quote:
I am tring to add a number of years to a dob. im doing this by adding my
date+years*365.26 I get a string of numbers. I then convert the number in
the next column to actual date again. I'm getting the correct date. Now I
want my criteria on that column to allow me to return only date in a given
to from period of my choosing. I try the between_and functions but nothing
is returned. I'm guessing it's because the column is still a calculation and
not a true date.

I've tried the make table query and running another query from that and
trying a seperate query from my original query. I can't seem to make this
happed. Is ther an easier way to:

Add a number of years to a date and have it reurn a date and not the number
string?
If not is there a better way to convert the string to a date?
Is there a way to get my criteria to recognize the date and return date
between my begin and end dates?

Sorry that this is so basic, I can;t find anything in the three books I've
bought that helps me understand this.

Thanks

John


The following should work for you:

DOB = Date
New_Date = DateAdd("yyyy", 3, DOB)

This example adds 3 years to DOB.

The format for the DateAdd() function is:

DateAdd(interval, number, date)

Check out MS-Access help for a complete description of the DateAdd()
function.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.