Results 1 to 3 of 3
  1. #1
    Chet is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2012
    Posts
    2

    Smile Changing the century part of the date.

    I receive Excel files that were downloaded from QuickBooks. They use a date such as: 03/05/28. Any date that falls below 1930 it defaults to the next century. So I get it as 03/05/2028. I simply want to subtract 100 years from the year if the year is greater than 1999. I want to update the field using an update querry. Here's how I see it.



    If the DOB is greater than #12/31/1999# subtract 100 from the year.

    I cannot seem to get the coding right. I've search for examples. Tried several combinations of critera. Any help would be appreciated. Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Try this in the UpdateTo row of query:
    IIf([DOB]>#12/31/1999#, DateAdd("yyyy",-100,[DOB]),[DOB])
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Chet is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2012
    Posts
    2
    I could not leave without saying Thanks a ton for being there!!!!
    Chet

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Getting Just the Date part of Date/Time field
    By GaryElwood in forum Reports
    Replies: 7
    Last Post: 09-28-2011, 09:58 AM
  2. Changing tables based on field date
    By dssrun in forum Programming
    Replies: 6
    Last Post: 07-10-2011, 10:17 AM
  3. Replies: 4
    Last Post: 10-14-2010, 04:49 PM
  4. WHERE as part of JOIN not after
    By thestappa in forum Queries
    Replies: 1
    Last Post: 05-14-2010, 10:52 AM
  5. Changing a date to the current year
    By fdnyfish in forum Access
    Replies: 1
    Last Post: 03-01-2008, 08:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums