Results 1 to 4 of 4
  1. #1
    deepakg27 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    160

    Query giving strange results

    Hi guys,



    I am working on a production database. (I am Attaching copy of database for your ready reference.)

    In my data base I have entered the values of the production. (production field is set to Number with double, decimal places 2 , format standard).

    Now When I try to query my total production from 1st August 2017 to 31st January 2018, I get dayshift result in 9368.76000000001 where as the result should be 9368.76. Cant get from where .000000001 is being added and displayed in the result. Further if I shift the date from 1st September 2017 to 31st January 2018, no extra zeroes and 1 is shown. Even so if I set the date range to 1st August 2017 to 31st December 2017 then also no zeroes are shown.

    Only when the date is set to 1st August 2017 to 31st January 2018, the problem occurs. (Even so if the date is set to 10th August to 31st January 2018 the problem does not occur). Please look into it and help. I can avoid the trouble with setting the format properties for the field in query but would like to find where the problem is. It could trouble me in future in some bigger calculations, hence please help and guide.

    Awaiting your guidance. (File Attached.)

    Thanks and Regards
    Deepak Gupta
    Attached Files Attached Files

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    I haven't looked at your database

    For info, Access calculates dates to 1 second accuracy and stores these as double number datatype ...so you are using this in your calculations.
    1 day = 1; 6 hours = 0.25; 1 second = 0.000011574 (approx)

    Double is subject to floating point (or rounding) error which has almost certainly triggered the .000000001 discrepancy.
    This amounts to a time interval of around 0.1 milliseconds if my calculation is correct - meaningless however

    There's nothing magical about those dates, other date ranges could also trigger similar discrepancies
    Either ignore it or round to a specified number of d.p. e.g. 2

    HTH
    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

  3. #3
    deepakg27 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    160
    Thanks for the help.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Deepak,

    You said
    I am working on a production database
    .

    I hope in reality you are working on a copy of your production database.

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

Similar Threads

  1. do until not giving me individual results
    By Ruegen in forum Programming
    Replies: 18
    Last Post: 12-08-2013, 05:03 PM
  2. Search Query not giving all results
    By wrkadri in forum Queries
    Replies: 5
    Last Post: 02-05-2013, 12:37 AM
  3. Calculation in Query giving wrong results
    By dargo72 in forum Queries
    Replies: 11
    Last Post: 11-07-2012, 05:39 AM
  4. Replies: 3
    Last Post: 07-13-2012, 09:18 AM
  5. Replies: 5
    Last Post: 10-27-2011, 09:08 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