Results 1 to 3 of 3
  1. #1
    Darla is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    May 2016
    Posts
    25

    updating the date format in a table?


    Hi everyone. I have a table with several fields that contain either a date or text. The current format is mm/dd/yyyy if the value is a date. How do I change the date format to mm/dd/yy without messing with the field if it contains text instead of a date?

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    In Access, you cannot have mixed data types within a single field. Each field can only be a single data type.
    If you look at the Properties of the table, it will list the data type for each field. I am willing to bet that this field you are talking about is set to "Text", or else you wouldn't be able to have non-date Text entries in it.
    So that means that each of your "date" entries is really text, so you can use Text functions like LEFT, RIGHT, and MID on it.

    I recommend using an IIF function along with ISDATE to check to see which of these text entries are valid dates, and doing the calculation on those.
    That formula would look something like:
    Code:
    IIF(IsDate([MyField]), Format(CDate([MyField]),"mm/dd/yy"),[MyField])

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    This link helps to understand how Access actually stores the DateTime field: https://support.microsoft.com/en-us/kb/130514

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

Similar Threads

  1. Updating several records with new format.
    By mbenton in forum Access
    Replies: 6
    Last Post: 07-29-2016, 02:31 PM
  2. Date changes format when inserted into table.
    By todmac in forum Programming
    Replies: 3
    Last Post: 07-08-2016, 11:12 AM
  3. Replies: 2
    Last Post: 08-16-2015, 07:04 PM
  4. Replies: 4
    Last Post: 03-12-2013, 06:49 PM
  5. Replies: 7
    Last Post: 07-12-2012, 02:35 PM

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