473,387 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Find Age in a year, given the Birth Date

Hi,

I have a table named Admittance, it has fields, Case Number, Birth Date that stores all patients admitted till date starting many years earlier.
I need to find out the age (in years and months) of all patients in the year 2007.
The main aim is to find out if any one of them was 18 yrs old in 2007.
Hope I explained enough to understand the requirement.

Please help,

Thanks
Jan 18 '08 #1
3 3397
jaxjagfan
254 Expert 100+
Hi,

I have a table named Admittance, it has fields, Case Number, Birth Date that stores all patients admitted till date starting many years earlier.
I need to find out the age (in years and months) of all patients in the year 2007.
The main aim is to find out if any one of them was 18 yrs old in 2007.
Hope I explained enough to understand the requirement.

Please help,

Thanks
Select Admittance.[Case Number],DateDiff("m",[Birth Date], 12/31/2007)/12 as Age From Admittance Where DateDiff("m",[Birth Date], 12/31/2007)/12 is Between 18.0 and 18.9999;

This would return Age in decimal values 18.5 would be 18 yrs 6 months
Jan 18 '08 #2
Select Admittance.[Case Number],DateDiff("m",[Birth Date], 12/31/2007)/12 as Age From Admittance Where DateDiff("m",[Birth Date], 12/31/2007)/12 is Between 18.0 and 18.9999;

This would return Age in decimal values 18.5 would be 18 yrs 6 months

I tried your query, but for a Case number with Birth Date of 1/1/1918, its giving the Age as -18.083333 !!

Please help

Thanks
Jan 22 '08 #3
jaxjagfan
254 Expert 100+
I tried your query, but for a Case number with Birth Date of 1/1/1918, its giving the Age as -18.083333 !!

Please help

Thanks
What is the actual format of the birth date column? Access read that record as 1/1/2018.
Jan 22 '08 #4

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

Similar topics

3
by: dik mus | last post by:
Hi, I connect to a database that only stores the year and weeknumber. But i need the date of the corresponding monday. This could be more difficult as one expect because the weekumbers might...
3
by: Matt | last post by:
Given a date, how to find the beginning date and ending date of that week please advise!
6
by: Burghew | last post by:
Hello, I generate invoices for my customers evry month. I want to keep a form which will allow the user to select the Month and Year through a combo and thus generate reports based on the month...
14
by: Lyle Fairfield | last post by:
Year Numbers A recent post prompts me to point out a capability of JET 4.0, to set the seed and increment of identity columns. (This is not a solution for that post.) I create a Table named...
1
by: ibiza | last post by:
Hi all, I need to find a specific, for example the third friday of a given month/year. How to do that? thanks :)
2
by: Matuag | last post by:
Hi All, I am trying to create a form which can calculate with Age and Birth Date fields. I want Age to be calculated based on Birth Date (which I managed to do) but at the same time if Birth...
2
by: Scott | last post by:
I have two fields in a query that hold dates. One is DOB, the other is HireDate. I want to add a field to a query that will take the employees DOB and based on their hire date, wil display their...
4
by: cjohns | last post by:
I am brand new to programing and am trying to write a C++ program that calculates how many days are left to a persons birthday. I need to make a function for the leap years, and to get number of...
1
by: karimufeed | last post by:
I am working on an access project for pension calculation. I want to generate the retirement date automatically at the age of 60 years while filling the date of Birth. i.e. if the Date of birth is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.