Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wierd Date format

Status
Not open for further replies.

ptrifile

Technical User
Aug 10, 2004
457
US
I am trying to create a query that will join 2 tables together when they have the same first and last name and same Date Of Birth....however the one table is from a different database and it is in the following format:

If the date of birth was 12011972 the database shows it as 1721201 or if the birthdate was 01311994 it shows 1940131

Basically YYYMMDD

Is it somehow possible to query these and have it decipher between the 2 formats?

Thank you!!

Paul
 
A starting point:
yyymmdd2date: DateSerial(1800+Left(yyymmdd,3),Mid(yyymmdd,4,2),Right(yyymmdd,2))

mmddyyyy2date: DateSerial(Right(mmddyyyy,4),Left(mmddyyyy,2),Mid(mmddyyyy,3,2))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV, Thanks! However, I am not sure what the next step would be on making this work in a query...I took a couple stabs at it but could not make it work. If you could elaborate a little on this I would appreciate it beyond imagination!

Thanks!!
Paul
 
what's the query you've almost got working?

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
 
Hi lespaul, I dont really have anything almost working. I didnt know where to begin using that code so I just started putting it anywhere I could in the query but to no avail.....any tips would be great! Thanks!

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top