Results 1 to 2 of 2
  1. #1
    Optimus_1 is offline Novice
    Windows 98/ME Access 2002
    Join Date
    May 2010
    Posts
    13

    Basic reporting question

    Hello



    I have set up a report in the attached DB and I am trying to produce a report that only returns the 'operatives' that have used over 100 points per day.

    Note: this could be an accumulatiuon of two or three lines of transaction for the same day etc..

    many thanks - any further explaination please ask.

    thanks

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Your first issue is that you don't have a normalized database. You have repeating fields in your main table. Correct this and it will save you lots of issues and make your queries easier to manage.

    Here is a white paper on data base relationships.

    http://www.deeptraining.com/litwin/d...aseDesign.aspx

    In the meantime, make your query an aggregate query. Here is the SQL from your query for making it an aggregate.

    Code:
    SELECT tblPersonalDetails.Name, tblOperatingTool.Description AS Tool, tblMain.[Week Commencing], tblMain.Mon, Sum([Points p/hour]*[Mon]) AS MonPts, tblMain.Tues, Sum([Points p/hour]*[Tues]) AS TuesPts, tblMain.Weds, Sum([Points p/hour]*[Weds]) AS WedsPts, tblMain.Thurs, Sum([Points p/hour]*[Thurs]) AS ThursPts, tblMain.Fri, Sum([Points p/hour]*[Fri]) AS FriPts, tblMain.Sat, Sum([Points p/hour]*[Sat]) AS SatPts, tblMain.Sun, Sum([Points p/hour]*[Sun]) AS SunPts
    FROM tblPersonalDetails INNER JOIN (tblMain INNER JOIN tblOperatingTool ON tblMain.[Tools Input 1] = tblOperatingTool.Description) ON tblPersonalDetails.OperatorID = tblMain.OperatorID
    GROUP BY tblPersonalDetails.Name, tblOperatingTool.Description, tblMain.[Week Commencing], tblMain.Mon, tblMain.Tues, tblMain.Weds, tblMain.Thurs, tblMain.Fri, tblMain.Sat, tblMain.Sun
    ORDER BY tblPersonalDetails.Name, tblMain.[Week Commencing];
    It will be cleaner looking if you normalize this and then aggregate by date.

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

Similar Threads

  1. Basic Question
    By za20001 in forum Queries
    Replies: 2
    Last Post: 04-11-2011, 03:59 PM
  2. basic (sorry) question
    By wokeeffe in forum Database Design
    Replies: 1
    Last Post: 12-21-2010, 11:20 AM
  3. Basic Question
    By Dalagrath in forum Forms
    Replies: 12
    Last Post: 10-31-2010, 05:36 AM
  4. Question on Reporting
    By jbarrum in forum Access
    Replies: 20
    Last Post: 01-14-2010, 02:05 PM
  5. Rookie needs help with basic reporting
    By James Rousselle in forum Reports
    Replies: 0
    Last Post: 03-01-2007, 02:36 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