R rinova Registered User. Local time Today, 01:30 Joined Aug 27, 2012 Messages 74 May 28, 2019 #1 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
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
theDBguy I’m here to help Staff member Local time Yesterday, 22:30 Joined Oct 29, 2018 Messages 22,496 May 28, 2019 #2 Yes. It should be possible. Is your date of birth field Text or DateTime data type?
R rinova Registered User. Local time Today, 01:30 Joined Aug 27, 2012 Messages 74 May 28, 2019 #3 Date of birth is text
theDBguy I’m here to help Staff member Local time Yesterday, 22:30 Joined Oct 29, 2018 Messages 22,496 May 28, 2019 #4 rinova said: Date of birth is text Click to expand... For starters, then, you could try the following to see if it converts Text to Date. Code: CDate(Format([DOB],"@@@@-@@-@@"))
rinova said: Date of birth is text Click to expand... For starters, then, you could try the following to see if it converts Text to Date. Code: CDate(Format([DOB],"@@@@-@@-@@"))
R rinova Registered User. Local time Today, 01:30 Joined Aug 27, 2012 Messages 74 May 28, 2019 #5 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
theDBguy I’m here to help Staff member Local time Yesterday, 22:30 Joined Oct 29, 2018 Messages 22,496 May 28, 2019 #6 rinova said: 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 Click to expand... 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!
rinova said: 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 Click to expand... 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!