Results 1 to 12 of 12
  1. #1
    kfbeal is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    16

    Query, Form & Report Design & Layout

    I have an access database with a single table that has 3 fields; Meter, Date/Time & KW. The data has multiple meters with data that is stored in 15 minute intervals.

    We need to be able to pull the Max KW for each Meter on a 15 minute interval for a specified date range .

    We also need to pull the Max KW of each Meter on a 60 minute average for each hour for a specified (input) date range.

    Some of these meters will be totalized so would it be possible to totalize a selected group of Meter's Max KW based on the specified date range.

    I've been able to create qryGetMeterNumber query pulling back the DISTINCT meter numbers. I then created a form fmGetKW and added combo boxes for Meter Number and 2 other combo boxes for the Start & End dates.

    I then created a qryGetKW query to pull the meter, date/time & kw with the meter number tied to the form combo box of Meter Number.

    Is there an easy way to multiply all of this or do I have to run each one separately? I'm used to generating basic queries and getting easy data, but I feel I'm over-thinking this whole process.

    Thanks,


    Keith

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,841
    would help if you provided some example data and the outcome required. I struggle to understand what this means

    We also need to pull the Max KW of each Meter on a 60 minute average for each hour for a specified (input) date range.

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Welcome to the forum, Keith.

    I agree with Ajax- we need more info...

    I know you are already using the dB, but "Date/Time" is a POOR field name.

    How is the data (MeterNumber, KW, ReadingDateTime) being input into the dB?

    When you say "We need to be able to pull ....", do you mean view it on a form or be able to print a report, of both???
    Last edited by ssanfu; 06-16-2020 at 03:01 PM.

  4. #4
    Join Date
    Apr 2017
    Posts
    1,773
    You need a tables like
    tblMeters: MeterID, [MeterNo], MeterInfo; (You can use manually entered MeterNo as PK, and omit autonumeric MeterID, or you can use both of them. In case you use both, MeterNo must be indexed and unique)
    tblMeterGroups: MeterGroupID, [MeterGroupNo], MeterGroupInfo; (You can use manually entered MeterGroupNo as PK, and omit autonumeric MeterGroupID, or you can use both of them. In case you use both, MeterGroupNo must be indexed and unique)
    tblMeterGroupMeters: MeterGroupMeterID, MeterGroupID/MeterGroupNo, MeterID/MeterNo; (You use PK fields of tblMeteres and tblMeterGroups for links. The pair of them must result as composite unique index)
    tblMeterReads: MeterReadID, MeterID/MeterNo, ReadTime, KW (You use PK fields of tblMeteres as link. MeterID/MeterNo and ReadTime must result as composite unique index).

    All totals you need, you can get running different queries. You can view results either in form(s) or in report(s) with such quer(y/ies) as source(s).

  5. #5
    kfbeal is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    16
    I hope this helps:

    Click image for larger version. 

Name:	meter-kw.PNG 
Views:	23 
Size:	44.8 KB 
ID:	42196

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,841
    OK so taking one meter as an example (5012), from the data on the right, what is the calculation that arrives at 45.28 - from your description and the data provided it should be 36.39. And the calculation that returns 38.25? I would expect to see 4 values per hour, but based on the data provided, would this be 29.12 (based on averaging the 3 values) or 21.84 (based on averaging 4 values where one is 0)

  7. #7
    kfbeal is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    16
    Quote Originally Posted by Ajax View Post
    OK so taking one meter as an example (5012), from the data on the right, what is the calculation that arrives at 45.28 - from your description and the data provided it should be 36.39. And the calculation that returns 38.25? I would expect to see 4 values per hour, but based on the data provided, would this be 29.12 (based on averaging the 3 values) or 21.84 (based on averaging 4 values where one is 0)
    Sorry, the database structure was just a snippet to show how the structure was, not all of the data (which was just bogus data for example) was included.

    The 45.28 would be the peak value of meter 5012 between 4/27/2020 & 5/26/2020. It's just not listed in the database structure data.

    The same goes for 32.38 is the peak value of 5014 between 4/27/2020 & 5/26/2020 and so on. Then the total Peak KW is the SUM of all of the meter's (5012, 5014, 5029) Peak KW.

    Hopefully that clears it up.

  8. #8
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Hmmmm, it would be nice if you were to post the dB.
    Since my questions weren't answered, I'll step away and not cause background noise.




    Good luck with your project..........

  9. #9
    kfbeal is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    16
    Quote Originally Posted by ssanfu View Post
    Hmmmm, it would be nice if you were to post the dB.
    Since my questions weren't answered, I'll step away and not cause background noise.




    Good luck with your project..........
    I believe I did somewhat in the image, except for how the data actually gets put into the database, which is manually imported via Excel file. The image shows the output requested within the table, if it's at all possible with a button to display & export the data. I had issues attaching it for some reason so I compressed it.

    Eventually these meters will dump this data into an SQL database which I would use an Access Query to query that data into this same database.

    VLP-Metering.zip

  10. #10
    CarlettoFed is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    273

    Risposta

    You should explain these anomalies with respect to the data in the database

    Click image for larger version. 

Name:	Immagine.png 
Views:	16 
Size:	84.7 KB 
ID:	42231

  11. #11
    kfbeal is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    16
    Quote Originally Posted by kfbeal View Post
    Sorry, the database structure was just a snippet to show how the structure was, not all of the data (which was just bogus data for example) was included.
    I just threw data in there to display it merely as an example, it's not actual database data. I was in a hurry to get something together to provide examples.

  12. #12
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,841
    rather than providing example data that 'doesn't add up' to the result required. Provide example data that does. Or adjust your result to reflect the data actually provide. At the moment we have the equivalent of example data of 1, 2, 3, 7, 9 and the answer is 6.

    I was in a hurry to get something together to provide examples.
    So your thinking is that 'save me some time, hopefully someone will understand'. In reality it is taking more time (and ours) as we try to understand your requirement.

    Since you have not confirmed my understanding of your calculation as expressed in post #6 I have to assume I am wrong. So I also will step away.

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

Similar Threads

  1. Replies: 18
    Last Post: 11-04-2014, 02:10 PM
  2. Form Layout Design Help
    By rhubarb in forum Database Design
    Replies: 5
    Last Post: 06-13-2014, 08:06 AM
  3. Replies: 6
    Last Post: 03-08-2014, 12:47 PM
  4. Best design for table layout
    By tagteam in forum Database Design
    Replies: 3
    Last Post: 04-18-2013, 12:54 PM
  5. Database Design and Layout
    By rhys.downard in forum Database Design
    Replies: 1
    Last Post: 02-29-2012, 09:49 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