By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,968 Members | 1,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,968 IT Pros & Developers. It's quick & easy.

Function to calculate Age and create a spreadsheet

P: 77
Hi,

I have a table (Admittance) that has birth dates of all cases admitted, fields being (Case Number and Birth Date). I also have a form that asks the user to select a year and click the 'Find' button to get a list of all the Cases that were 18 yrs old on the year selected.

The way I want to do this is, invoke an event on 'Find' button click that will accept the year selected and looping throught the entire table,
do the following,
format a variable, Entry Date = mm/dd/yyyy, where mm = Month from birth date field, dd = day from birth date field and yyyy = year accepted from the form.
If (Entry Date - Admittance.Birth Date) = 18 yrs move it to a spreadsheet.

End of logic.

Hope I explained the logic properly. In a nutshell I am trying to get all the cases on to a spreadsheet that are 18 yrs old on the year entered by the user.

Please help.


Thanks
Jan 22 '08 #1
Share this Question
Share on Google+
2 Replies


jaxjagfan
Expert 100+
P: 254
Hi,

I have a table (Admittance) that has birth dates of all cases admitted, fields being (Case Number and Birth Date). I also have a form that asks the user to select a year and click the 'Find' button to get a list of all the Cases that were 18 yrs old on the year selected.

The way I want to do this is, invoke an event on 'Find' button click that will accept the year selected and looping throught the entire table,
do the following,
format a variable, Entry Date = mm/dd/yyyy, where mm = Month from birth date field, dd = day from birth date field and yyyy = year accepted from the form.
If (Entry Date - Admittance.Birth Date) = 18 yrs move it to a spreadsheet.

End of logic.

Hope I explained the logic properly. In a nutshell I am trying to get all the cases on to a spreadsheet that are 18 yrs old on the year entered by the user.

Please help.

Thanks
There wasn't a response to your last post

http://www.thescripts.com/forum/thread760945.html

I had asked what was the format of the Birth Date field. My formula calculated the age as -18.0XXX. for someone you had given a Birthdate of 1918. In order for Access to calc a negative age, Access read the year as 2018. Are the dates in 01/01/18 type format?
Jan 22 '08 #2

P: 77
There wasn't a response to your last post

http://www.thescripts.com/forum/thread760945.html

I had asked what was the format of the Birth Date field. My formula calculated the age as -18.0XXX. for someone you had given a Birthdate of 1918. In order for Access to calc a negative age, Access read the year as 2018. Are the dates in 01/01/18 type format?

Sorry I didn't see your reply until now.
The date format is 01/01/1918, not 01/01/18.

Thanks
Jan 23 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.