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

# Urgent - Find age in each month of a year

 P: 77 I have the list of patients in the admittance table who were in care during the years 2004, 2005 and 2006. The admittance table has fields, CaseID, SeqNbr, Birthdate I want to find the patients who were 18 years and 1 month old in Jan 2004, Feb 2004.....Dec 2004 (basically each month of the year). Similarly I need to do the same for 2005 and 2006. Please treat this as urgent....thanks for the help. Jan 4 '08 #1
Share this Question
1 Reply

 Expert 100+ P: 1,923 I have the list of patients in the admittance table who were in care during the years 2004, 2005 and 2006. The admittance table has fields, CaseID, SeqNbr, Birthdate I want to find the patients who were 18 years and 1 month old in Jan 2004, Feb 2004.....Dec 2004 (basically each month of the year). Similarly I need to do the same for 2005 and 2006. Please treat this as urgent....thanks for the help. Try this: The following query uses the Age() function at this link: http://allenbrowne.com/func-08.html Expand|Select|Wrap|Line Numbers SELECT DatePart(Year(AdmitDate)) As AdmitYear , DatePart(Month(AdmitDate)) As AdmitMonth, CaseID, SeqNbr, BirthDate, Age([BirthDate]) As BirthAge FROM AdmittanceTable WHERE Round(BirthAge,2) = 18.09 GROUP BY AdmitYear,  AdmitMonth, CaseID, BirthDate, BirthAge ORDER By AdmitYear, AdmitMonth, CaseID, BirthDate;    Jan 5 '08 #2

### Post your reply

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