Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2019
    Posts
    1,046

    Query modification returns *unexpected* (different) results for another expression

    Hello Experts:

    I'd like some assistance with the "DateDiff" function in Access. Attached DB contains both an ACCDB file (single table w/ 6 sample records) and one (1) query.

    The query does output the correct date difference (with date diff in *days*). However, when copying the same "Days" expression and adding "Hours", the output for "Days" completely changes. (I had hoped I will get the same days output but also the date difference in hours, too).



    As the saying goes, a "picture is worth a thousand words", I have added the 4 steps (as part of my modification) into a PPT slide deck. I think it'll be much easier to follow along after reviewing the slide deck (vs. me attempting to write lengthy paragraphs here).

    Ultimately, my question is as follows: Why does the addition of the "HRS" expression change the output for the "DAYS" expression? Specifically, see slide #4 for the illustrating the outputs.

    Thanks,
    Tom
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Don't edit query in DesignView. This changes the JOIN clause. It removes non-equivalent expression. Access had to 'fix' because true to its warning, could not be represented in DesignView.
    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.

  3. #3
    Join Date
    Feb 2019
    Posts
    1,046
    Thank you, June7... I wasn't aware of that element.

    I added the "hours", "min", and "sec" in SQL mode and the results come back as expected. Thank you!

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

Similar Threads

  1. Simple query returns no results
    By jhuvba in forum Queries
    Replies: 5
    Last Post: 10-01-2018, 12:45 PM
  2. Unexpected sort results
    By George in forum Modules
    Replies: 17
    Last Post: 07-21-2016, 08:00 PM
  3. Unexpected results on Inner Join
    By Access_Novice in forum Access
    Replies: 2
    Last Post: 09-05-2014, 12:50 AM
  4. Query returns ro results
    By MichealShinn in forum Queries
    Replies: 5
    Last Post: 02-21-2012, 01:24 PM
  5. Query showing unexpected results
    By johnmerlino in forum Queries
    Replies: 30
    Last Post: 10-25-2010, 07:08 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