A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Ages



 
 
Thread Tools Display Modes
  #1  
Old November 6th, 2005, 03:21 PM
Denis
external usenet poster
 
Posts: n/a
Default Ages

How can I work out ages in years and months from an "DateofBirth" field in a
access database report?
This is the first time i have tried to calculate this so would like some
guidance please.
Regards
Denis

  #2  
Old November 6th, 2005, 03:25 PM
Allen Browne
external usenet poster
 
Posts: n/a
Default Ages

Take a look at:
A More Complete DateDiff Function
at:
http://www.accessmvp.com/djsteele/Diff2Dates.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Denis" wrote in message
...
How can I work out ages in years and months from an "DateofBirth" field in
a
access database report?
This is the first time i have tried to calculate this so would like some
guidance please.
Regards
Denis



  #3  
Old November 6th, 2005, 09:05 PM
Ron Weiner
external usenet poster
 
Posts: n/a
Default Ages

If you want a simple function that ONLY returns an age in Years and months
you can find one here http://www.worksrite.com/GetAge.htm

--
Ron W
www.WorksRite.com
"Denis" wrote in message
...
How can I work out ages in years and months from an "DateofBirth" field in

a
access database report?
This is the first time i have tried to calculate this so would like some
guidance please.
Regards
Denis



  #4  
Old November 7th, 2005, 09:19 AM
Denis
external usenet poster
 
Posts: n/a
Default Ages

Ron
Copied in the function, changing the DOB for DateofBirth field I have in my
batabase but it came up with an error highlighting "Then". Can you advise?
Regards
Denis


"Ron Weiner" wrote:

If you want a simple function that ONLY returns an age in Years and months
you can find one here http://www.worksrite.com/GetAge.htm

--
Ron W
www.WorksRite.com
"Denis" wrote in message
...
How can I work out ages in years and months from an "DateofBirth" field in

a
access database report?
This is the first time i have tried to calculate this so would like some
guidance please.
Regards
Denis




  #5  
Old November 8th, 2005, 02:25 AM
Ron Weiner
external usenet poster
 
Posts: n/a
Default Ages

How are you calling the function. As Written it was designed to be called
with two parameters the Start Date (BornOnDate) and the End Date (typically
today's Date). So when I call it like this:

? getagestr("1/30/47",date)

from the Immediate Window it prints

58y-10m
Which is my current age.

Exactly how are you attempting to use this function?

--
Ron W
www.WorksRite.com
"Denis" wrote in message
...
Ron
Copied in the function, changing the DOB for DateofBirth field I have in

my
batabase but it came up with an error highlighting "Then". Can you advise?
Regards
Denis


"Ron Weiner" wrote:

If you want a simple function that ONLY returns an age in Years and

months
you can find one here http://www.worksrite.com/GetAge.htm

--
Ron W
www.WorksRite.com
"Denis" wrote in message
...
How can I work out ages in years and months from an "DateofBirth"

field in
a
access database report?
This is the first time i have tried to calculate this so would like

some
guidance please.
Regards
Denis






  #6  
Old November 9th, 2005, 09:41 AM
Denis
external usenet poster
 
Posts: n/a
Default Ages

Ron
The database is for employees with a field "DateofBirh" completed dd/mm/yyyy
and I am trying to work out their ages in months yy and mm. This is due to
age requirements for some positions that are need to be filled.

Regards
Denis


"Ron Weiner" wrote:

How are you calling the function. As Written it was designed to be called
with two parameters the Start Date (BornOnDate) and the End Date (typically
today's Date). So when I call it like this:

? getagestr("1/30/47",date)

from the Immediate Window it prints

58y-10m
Which is my current age.

Exactly how are you attempting to use this function?

--
Ron W
www.WorksRite.com
"Denis" wrote in message
...
Ron
Copied in the function, changing the DOB for DateofBirth field I have in

my
batabase but it came up with an error highlighting "Then". Can you advise?
Regards
Denis


"Ron Weiner" wrote:

If you want a simple function that ONLY returns an age in Years and

months
you can find one here http://www.worksrite.com/GetAge.htm

--
Ron W
www.WorksRite.com
"Denis" wrote in message
...
How can I work out ages in years and months from an "DateofBirth"

field in
a
access database report?
This is the first time i have tried to calculate this so would like

some
guidance please.
Regards
Denis







  #7  
Old November 9th, 2005, 11:53 AM
Ron Weiner
external usenet poster
 
Posts: n/a
Default Ages

If you have a text box on your report that you want to hold the Age in Years
and months then set the controlSource of that text box to:
=getagestr([DateOfBirth],Date).
This assumes that you have a column in the RecordSource of the report whose
name is DateOfBirth, and that column is a DateTime data type.

If the RecordSource column DateOfBirth is a Text data type, then set your
textbox ControlSource to:
=getagestr(Format([DateOfBirth],"mm,dd,yyy"),Date).

--
Ron W
www.WorksRite.com
"Denis" wrote in message
...
Ron
The database is for employees with a field "DateofBirh" completed

dd/mm/yyyy
and I am trying to work out their ages in months yy and mm. This is due to
age requirements for some positions that are need to be filled.

Regards
Denis


"Ron Weiner" wrote:

How are you calling the function. As Written it was designed to be

called
with two parameters the Start Date (BornOnDate) and the End Date

(typically
today's Date). So when I call it like this:

? getagestr("1/30/47",date)

from the Immediate Window it prints

58y-10m
Which is my current age.

Exactly how are you attempting to use this function?

--
Ron W
www.WorksRite.com
"Denis" wrote in message
...
Ron
Copied in the function, changing the DOB for DateofBirth field I have

in
my
batabase but it came up with an error highlighting "Then". Can you

advise?
Regards
Denis


"Ron Weiner" wrote:

If you want a simple function that ONLY returns an age in Years and

months
you can find one here http://www.worksrite.com/GetAge.htm

--
Ron W
www.WorksRite.com
"Denis" wrote in message
...
How can I work out ages in years and months from an "DateofBirth"

field in
a
access database report?
This is the first time i have tried to calculate this so would

like
some
guidance please.
Regards
Denis









  #8  
Old November 9th, 2005, 11:58 AM
Ron Weiner
external usenet poster
 
Posts: n/a
Default Ages

Oooopppssss...

Typo on the format string should be
=getagestr(Format([DateOfBirth],"mm,dd,yyyy"),Date).

Sorry!!
--
Ron W
www.WorksRite.com
"Ron Weiner" wrote in message
...
If you have a text box on your report that you want to hold the Age in

Years
and months then set the controlSource of that text box to:
=getagestr([DateOfBirth],Date).
This assumes that you have a column in the RecordSource of the report

whose
name is DateOfBirth, and that column is a DateTime data type.

If the RecordSource column DateOfBirth is a Text data type, then set your
textbox ControlSource to:
=getagestr(Format([DateOfBirth],"mm,dd,yyy"),Date).

--
Ron W
www.WorksRite.com
"Denis" wrote in message
...
Ron
The database is for employees with a field "DateofBirh" completed

dd/mm/yyyy
and I am trying to work out their ages in months yy and mm. This is due

to
age requirements for some positions that are need to be filled.

Regards
Denis


"Ron Weiner" wrote:

How are you calling the function. As Written it was designed to be

called
with two parameters the Start Date (BornOnDate) and the End Date

(typically
today's Date). So when I call it like this:

? getagestr("1/30/47",date)

from the Immediate Window it prints

58y-10m
Which is my current age.

Exactly how are you attempting to use this function?

--
Ron W
www.WorksRite.com
"Denis" wrote in message
...
Ron
Copied in the function, changing the DOB for DateofBirth field I

have
in
my
batabase but it came up with an error highlighting "Then". Can you

advise?
Regards
Denis


"Ron Weiner" wrote:

If you want a simple function that ONLY returns an age in Years

and
months
you can find one here http://www.worksrite.com/GetAge.htm

--
Ron W
www.WorksRite.com
"Denis" wrote in message
...
How can I work out ages in years and months from an

"DateofBirth"
field in
a
access database report?
This is the first time i have tried to calculate this so would

like
some
guidance please.
Regards
Denis











 




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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dates of birth and ages fields ammeg General Discussion 1 June 24th, 2005 02:27 PM
How can I create a formula using 2 %'s for 2 sets of ages in the . AB General Discussion 2 March 3rd, 2005 06:12 AM
Ages of participants Desmond Running & Setting Up Queries 1 July 14th, 2004 11:51 PM
Need to Calculate Employee Ages Motra Worksheet Functions 3 June 4th, 2004 04:26 PM
Formula for ages from DOBs needed. calcatron Worksheet Functions 3 January 29th, 2004 09:50 PM


All times are GMT +1. The time now is 09:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.