Is it possible to convert date of birth and calculate age within a single query

rinova

Registered User.
Local time
Today, 01:30
Joined
Aug 27, 2012
Messages
74
Hi Everyone,

Hope everyone is doing well, I need some help. I need to know if it is possible to convert a date of birth (Ex: CCYYMMDD to MM/DD/CCYY and calculate age within a single query?

Thank you,

Rinova
 
Yes. It should be possible. Is your date of birth field Text or DateTime data type?
 
Date of birth is text
 
Date of birth is text
For starters, then, you could try the following to see if it converts Text to Date.
Code:
CDate(Format([DOB],"@@@@-@@-@@"))
 
I use CDATE to convert my DOB from CCYYMMDD to MM/DD/CCYY

CDate(Mid([DOB],5,2) & "/" & Right([DOB],2) & "/" & Left([DOB],4))

But I like yours better
 
I use CDATE to convert my DOB from CCYYMMDD to MM/DD/CCYY

CDate(Mid([DOB],5,2) & "/" & Right([DOB],2) & "/" & Left([DOB],4))

But I like yours better
Yeah, there's always more than one way to get something done in Access, for sure. Let us know if you need further assistance. Good luck!
 

Users who are viewing this thread

Back
Top Bottom