+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    04-02-2009
    Location
    Greenville, NC
    MS-Off Ver
    Excel 2003
    Posts
    4

    Query: Difference between date/time columns

    I have a database that has columns that include date & time. In a similar excel spreadsheet, I have an additional column that can subtract the difference between those date/time columns and give you the days/hours/minutes left. How can I mimic this in database? I am by far not a program, so please give me something simple if possible.

  2. #2
    Forum Guru
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2003
    Posts
    2,286

    Re: Query: Difference between date/time columns

    We have a lot in common, I am not a program either.

    I understand you are talking about how to subtract date from (date+time) to get times - correct? What do you mean by "database"? Are you talking about doing this in Access?

    CC

  3. #3
    Registered User
    Join Date
    04-02-2009
    Location
    Greenville, NC
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Query: Difference between date/time columns

    I accidentally posted this in an excel forum, I meant to put it in an access forum, but if you know the answer that would be great. I am successful with this in excel. The date/time in 1 columns subtracts itself from the date/time in another column and leaves you with days:hours:minutes. But I can't do this in access.

  4. #4
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Query: Difference between date/time columns

    Thread moved to Access Forum.

  5. #5
    Forum Guru
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2003
    Posts
    2,286

    Re: Query: Difference between date/time columns

    In Access, my question would be "what for?" you can just display time of date+time with a format (much like Excel). Creating an extra field to hold this information seems duplicative.
    My apologies if I've misunderstood.

    CC

  6. #6
    Forum Moderator ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2003 & 2010
    Posts
    1,798

    Re: Query: Difference between date/time columns

    Hi uneek78,

    If you are referring to the DATEDIF function in Excel, then there is a good article about it here:

    DATEDIF

    But in Access, you need to use a different version of this function; described here:

    DATEDIFF

    Hope this helps.

    Cheers,
    Docendo discimus.

    Please consider:
    • Thanking those who helped you. Click the reputation icon in the contributor's post and add Reputation.
    • Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0