Results 1 to 3 of 3
  1. #1
    clawschieff is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    4

    Need to use an update query on date string field

    Hi all,

    I have fields in MS Access 2010 for DOB, DOD, and DOI (Date of Internment) that are string fields. All of the records in this field are in the form of YYYYMMDD. I want to write an update query to change the format to MM/DD/YYYY (changing the order and adding the forward slash). I can do it in excel, but I don't want to export and then import back into Access, and I'd like to learn how to do everything I know how to do in excel in Access.



    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,952
    Try:

    DateSerial(Left([DOB],4), Mid([DOB], 5, 2), Right([DOB], 2))

    or

    Mid([DOB], 5, 2) & "/" & Right([DOB], 2)) & "/" & Left([DOB],4)
    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
    clawschieff is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    4
    Yep that worked,
    Thank you

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

Similar Threads

  1. Replies: 7
    Last Post: 08-26-2013, 06:05 AM
  2. string on button to update field values
    By mike02 in forum Access
    Replies: 10
    Last Post: 07-10-2013, 12:41 PM
  3. Update date field
    By Loucorea in forum Access
    Replies: 4
    Last Post: 09-26-2012, 08:22 PM
  4. Query to convert String to Date??
    By taimysho0 in forum Programming
    Replies: 3
    Last Post: 06-04-2012, 04:48 PM
  5. Replies: 7
    Last Post: 05-31-2011, 11:51 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