Results 1 to 5 of 5
  1. #1
    cebrower is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2018
    Location
    Spring Lake, MI
    Posts
    110

    Convert date from short date to general date

    I have a table with a date field that was originally defined as short date. I would like the existing records to to be converted to general date. I've changed it in the table definition and new records now display as general date, but the existing records still displays as short date. Any suggestions?

  2. #2
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    The short date and general date fields are one and the same - An Access datetime field.
    The short date format option just determines the display mode, and removes the visible time element, which will probably be 00:00 (Midnight)
    By default in a table access suppresses the time value when it is 00:00.

    This format can be overridden on a form or report to the presentation mode of your choice, it has no bearing on what is stored.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,976
    As you already know, short date won't show time component whereas general date does so.
    However no matter what the format, dates are stored as double numbers e.g. 6am today is stored as 43578.25
    If no time is specified, Access will assume a time of 00:00 and store the value as 43578.00
    It will just display the date without the time component

    That is exactly what you have for all your existing records which is why no time is shown
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  4. #4
    cebrower is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2018
    Location
    Spring Lake, MI
    Posts
    110
    The the date field in the existing records was populated in VBA using Me!ActionDate = Date. The new records are populated using me!ActionDate = Now. So if I understand correctly, the existing records don't include the time, only the date,

  5. #5
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Correct. The Date() function inserts the date only which defaults to 00:00 time value, as Colin stated above.
    Now() inserts the current date and time.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. Replies: 2
    Last Post: 10-30-2017, 02:33 PM
  2. Replies: 3
    Last Post: 10-16-2017, 11:47 AM
  3. Convert Short text column to date ms access
    By SameerSarswat in forum Access
    Replies: 3
    Last Post: 10-09-2014, 10:42 AM
  4. Replies: 4
    Last Post: 01-11-2014, 11:57 PM
  5. Replies: 3
    Last Post: 09-11-2013, 09:49 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