Results 1 to 4 of 4
  1. #1
    carlislewwtp is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    1

    Calculations

    Do not know where to start



    I operate a Water Treatment Plant and I am trying to build a data base to hold our information. One task I am trying to do is everyday we write down the water meter reading for the amount of water we have pumped for the past 24 hours. I have created a form and Table to log this information. Each day is a record in the Table. I need to subtract todays meter reading from yesterdays meter reading to get a total amount of water pumped.

    My coding abilities are very limited and I have been trying to use the builder function but I am not able to complete this calculation.

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Start with a clear business requirement -- a clear description of WHAT you intend to do in simple, English (no database or water treatment jargon).
    What else, besides recording the daily volumes, is involved and/or will be involved with this proposed database?
    Employees? Attendance? etc etc.....

    Lots of database planning and design info at this link.

    Good luck. (It sounds to me you are planning to build the database)

    -- See the info at this Heading for meter reading info

    Get the value in another record


    at http://allenbrowne.com/subquery-01.html

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Could you use a DLookup() to get the previous value?

  4. #4
    Join Date
    Apr 2017
    Posts
    1,681
    Something like
    Code:
    SELECT 
    m.MesuringDate, 
    (m.MeasuringValue - (SELECT TOP 1 m0.MeasuringValue FROM tblMeasurings m0 WHERE m0.MeasuringDate < m.MeasuringDate ORDER BY m0.MeasuringDate DESC)) AS [Qty] 
    FROM tblMeasurings m
    ORDER BY m.MeasuringDate ASC
    will give you list of quantities by dates

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

Similar Threads

  1. Help with calculations
    By chosenonee in forum Queries
    Replies: 7
    Last Post: 01-07-2016, 12:53 PM
  2. Replies: 30
    Last Post: 09-30-2015, 10:58 AM
  3. calculations
    By frustratedwithaccess in forum Queries
    Replies: 5
    Last Post: 01-08-2015, 01:56 PM
  4. calculations
    By DariusD in forum Access
    Replies: 3
    Last Post: 01-01-2013, 07:22 PM
  5. calculations??
    By richrit in forum Access
    Replies: 1
    Last Post: 04-11-2012, 05:06 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