Results 1 to 4 of 4
  1. #1
    veneeth is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    1

    I've a date and time format as mentioned below. I want to add +6:30 to it and then extract date

    I've a date and time format as mentioned below. I want to add +6:30 to it and then extract date and time into two different columns after adding the time.

    Sample data

    2014-01-08 00:38:57.000
    2014-06-20 12:54:34.000
    2014-06-25 15:03:04.000
    2014-06-25 15:03:04.000
    2014-06-25 15:03:04.000
    2014-06-25 15:03:04.000
    2014-06-25 15:15:45.000
    2014-06-25 15:15:45.000

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Tools you'll need include the DateAdd(), DateValue() and TimeValue() functions.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    thebigthing313 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    119
    In addition to pbaldy's suggestions, the millisecond portion of your date+time string will throw off these functions. Trim the millisecond portion out first before going through the functions, and then concatenate them at the end again if you really need it.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Assuming consistent structure and every record has value, try:

    DateAdd("h", 6.5, DateValue(Left([fieldname], 19)) + TimeValue(Left([fieldname], 19)))
    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.

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

Similar Threads

  1. Replies: 11
    Last Post: 07-20-2014, 06:22 PM
  2. Replies: 1
    Last Post: 03-13-2014, 07:23 PM
  3. Form Check Date/Time Format
    By JayRab in forum Forms
    Replies: 7
    Last Post: 02-23-2014, 09:24 PM
  4. Replies: 5
    Last Post: 06-23-2012, 04:30 PM
  5. Replies: 1
    Last Post: 08-07-2011, 07:58 AM

Tags for this Thread

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