Navyguy
Registered User.
- Local time
- Yesterday, 23:59
- Joined
- Jan 21, 2004
- Messages
- 194
I am using the qry below to determine someone's birthday, and it works good from my standpoint although it is not as elaborate as some of the other B-Day code I have seen in this forum.
SELECT Year([DOB]) AS [DOB Year], Month([DOB]) AS [DOB Month], Day([DOB]) AS [DOB Day], [Tbl-Personnel].[DOB], DateDiff("yyyy",[DOB],Date()) AS Age1, DatePart("y",[DOB])>DatePart("y",Date()) AS Age2, [Age1]+[Age2] AS Age, [Tbl-Personnel].Surname AS Surname, [Tbl-Personnel].[First Name] AS [First Name], [Tbl-Personnel].[Gender] AS [Gender], [Tbl-Personnel].[Group]
FROM [Tbl-Personnel]
ORDER BY Month([DOB]), Day([DOB]), [Tbl-Personnel].Surname, [Tbl-Personnel].[First Name];
My questions are:
1. On a form I would like to enter someone's birth date and have their age automatically display in a box called CurrentAge. That age need to be kept for reporting purposes later so it cannot be continuously calculated. This seems easy enough, but I having problems getting it to work.
2. On the same form I would also like to calculate someone's age from a specific date. So I would like to know how old Joe would be after 01 Sept 04 as an example after his birthday was inputted into the DOB field.
So in essence what I would like is two fields to be auto completed (CurrentAge and FutureAge) based on the entry in the DOB field that are all on the same form.
As always Thanks for your help.
SELECT Year([DOB]) AS [DOB Year], Month([DOB]) AS [DOB Month], Day([DOB]) AS [DOB Day], [Tbl-Personnel].[DOB], DateDiff("yyyy",[DOB],Date()) AS Age1, DatePart("y",[DOB])>DatePart("y",Date()) AS Age2, [Age1]+[Age2] AS Age, [Tbl-Personnel].Surname AS Surname, [Tbl-Personnel].[First Name] AS [First Name], [Tbl-Personnel].[Gender] AS [Gender], [Tbl-Personnel].[Group]
FROM [Tbl-Personnel]
ORDER BY Month([DOB]), Day([DOB]), [Tbl-Personnel].Surname, [Tbl-Personnel].[First Name];
My questions are:
1. On a form I would like to enter someone's birth date and have their age automatically display in a box called CurrentAge. That age need to be kept for reporting purposes later so it cannot be continuously calculated. This seems easy enough, but I having problems getting it to work.
2. On the same form I would also like to calculate someone's age from a specific date. So I would like to know how old Joe would be after 01 Sept 04 as an example after his birthday was inputted into the DOB field.
So in essence what I would like is two fields to be auto completed (CurrentAge and FutureAge) based on the entry in the DOB field that are all on the same form.
As always Thanks for your help.