Results 1 to 5 of 5
  1. #1
    Lifeseeker1019 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    6

    Subtracting a date/time field from a number to get date/time

    Hi there,



    I have a formatting problem and was wondering if anybody could help. I figured this might be possible only through VBA.

    what I need to do:

    Get the admission date/time by subtracting the DisTimeDateTime (formatted in date/time) from the DisRLOS (formatted as numeric).

    in the sample file attached, I just want to be able to go....20.9229 minus 13/02/2013 10:00:00 AM to get the admission date/time (formatted in date/time).

    The reason I'm doing is because DisRLOS is basically the result of distimedatetime - admtimedatetime. I know discharge date/time, but just need to get the admit date/time from LOS...


    Any help is much appreciated.
    Attached Files Attached Files

  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
    Well,

    [DisTimeDateTime]-[DisRLOS]

    in a query results in 1/23/2012 11:51:00 AM (US format since that's where I am).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Lifeseeker1019 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    6
    when I ran it, I got 06/12/1787 11:51:00 AM. Is this because of regional time difference? How do you fix this?

  4. #4
    Lifeseeker1019 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    6
    oh nvm...i got it backward....thank you

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 5
    Last Post: 03-19-2014, 02:31 PM
  2. Replies: 1
    Last Post: 03-13-2014, 07:23 PM
  3. Convert Number to Date/Time
    By Jerseynjphillypa in forum Queries
    Replies: 10
    Last Post: 06-13-2012, 12:33 PM
  4. Getting Just the Date part of Date/Time field
    By GaryElwood in forum Reports
    Replies: 7
    Last Post: 09-28-2011, 09:58 AM
  5. date/time number
    By playfuljade in forum Forms
    Replies: 4
    Last Post: 12-19-2005, 12:52 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