"Sam" <(E-Mail Removed)> wrote in message
news:84f67ee1-e8ec-4733-927f-(E-Mail Removed)...
>I have dates in a field as listed below
> Unformatted Date Formatted Date
> 931216 Format needed is 12/16/1993
> 960901 Format needed is 09/01/1996
> 1040813 Format needed is 08/13/2004
> 1011001 Format needed is 08/13/2001
>
> When the year in the unformatted date is less than the year 2000 it
> has a 2 digit year and if the year is greater than 1999 then there is
> a 3 digit year starting with 1 and then a 2 digit year.
>
> Could someone please help with a formula or code to convert this date
> to the MM/DD/YYYY format?
It's US Gregorian, not Julian, format that you're wanting to convert to.
This formula will convert the unformatted input to a Date/Time value:
CDate(Format((19000000 + CLng([UnformattedDate])), "0000-00-00"))
This formula will convert it to a string in your desired output format:
Format(Format((19000000 + CLng([UnformattedDate]), "0000-00-00")),
"mm/dd/yyyy")
--
Dirk Goldgar, MS Access MVP
Access tips:
www.datagnostics.com/tips.html
(please reply to the newsgroup)