Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    You could try this in the query design, sql view
    Code:
    SELECT A.[Bus Unit], B.Charge, B.Account
    , Sum(B.[Hours Paid]) AS [SumOfHours Paid]
    , Sum(B.[Earnings Amount]) AS [SumOfEarnings Amount]
    FROM [ref_Charge CC by Bus Unit] as A 
    INNER JOIN [2015 Payroll Data] AS B 
    ON A.[Charge CC] = B.Charge
    WHERE (((B.[Pay Period Number])="03" Or (B.[Pay Period Number])="04"))
    AND
     (((B.Account)="00013" Or (B.Account)="00014" Or (B.Account)="00019" Or (B.Account)="00021" Or (B.Account)="00024"))
    GROUP BY A.[Bus Unit], B.Charge, B.Account
    ORDER BY A.[Bus Unit], B.Charge, B.Account;
    You really should remove all the embedded spaces in names, when you get a chance.

  2. #17
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    For reference:
    When you cross post you should advise readers that you have done so.
    It isn't wrong to cross post, it is wrong to not inform people.

    Here's why.

    Good luck with your project.

  3. #18
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    PMFJI,

    Just a few comments.

    I totally agree with orange about the use of spaces in object names. Shouldn't do it.


    I would have "Pay Code" in a look up TABLE (not field). You wouldn't have to type as much (the long description) and it would be consistent entries. In the table, you could have a Boolean field to indicate if the record should be used in the "ActualHours" calculation. Instead of the query field (in RED), you could use
    Code:
    ActualHours: IIF([Pay Code], [hours paid],0)

    I question the table structure. You have a table "[2015 Payroll Data]". Anytime the year is used in the name of a table, it tells me that the structure is not normalized. When the year changes, do you have to edit the queries, forms and reports? If so, this is is considered a bad design.

    The year "2015" in the table name is actually data. The table "Payroll Data" should have an additional field for the year. Then just filter by year - no design changes needed when the year changes.



    Maybe you already know this. I don't know your level in Access, but I thought I would bring it up, just in case...

  4. #19
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Sorry, I was away out of town for a few days, but looks like you got some good responses from Orange and ssanfu.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 07-29-2014, 11:20 AM
  2. Replies: 1
    Last Post: 02-19-2014, 11:07 AM
  3. Replies: 9
    Last Post: 01-03-2013, 04:04 PM
  4. Replacing many values at once in a multiple values checkbox field.
    By ConfusedDatabaseDesigner in forum Forms
    Replies: 2
    Last Post: 07-20-2012, 08:58 AM
  5. MS Access sum values of one field in all records of one table
    By logamuthu in forum Import/Export Data
    Replies: 2
    Last Post: 11-22-2011, 12:39 PM

Tags for this Thread

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