Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Aug 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    convert 4 digit year to 2 (2003)

    Ok, I know this is simple, in most cases. Maybe in this one too but I can not figure it out. I need to convert the year into a two digit year instead of the current 4 digits. I am using linked tabels from an alpha system and reporting from this data. The dates on this Alpha server are in "1900" and come accross as "1906" instead of "2006" and I need to display the proper dates for the formal reports. I have tried every trick I know to get this to work, to no avail. I have tried formatting the field on the report to a medium date, no go. I even tried short date and NO, STILL FOUR DIGITS! The only way to this point I have won this battle was to export to excel and change the date from 1906 to 2006. Oddly enough when I report off of this data I get the two digits I require. Anybody who can help would be my hero! Thanks in advance for any assistance!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: convert 4 digit year to 2 (2003)

    What is the data type of the imported data? Your description makes me suspect it is text instead of date/time.

  3. #3
    Lounger
    Join Date
    Aug 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: convert 4 digit year to 2 (2003)

    You would think so with all of the trouble it is giving me but it is actually a Date/Time field. I guess the "1900" dates are somehow challenged by the Y2K fixes in Access?

  4. #4
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: convert 4 digit year to 2 (2003)

    A thought from WAY out of left field here...

    I believe Access uses 1st Jan 100 AD as its base date (i.e. day 0)

    Maybe this other thing uses 1st Jan 0000 BC/AD or whatever it should be!
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: convert 4 digit year to 2 (2003)

    To get real 21st century dates by calculating them in a query:

    DateAdd("yyyy",100,[DateField])

    Or you should be able to set a custom date format mm/dd/yy.

    Also see the "Use four-digit year formatting" setting in the General tab of Tools | Options...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •