Results 1 to 4 of 4
  1. #1
    brow1726 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2012
    Posts
    13

    For summing if name is in one of 3 fields with a date time frame

    So I have been at this for a few days and I am stumped. I am trying to pull names from one table and if there name is in either position A, B, or C it will take that number and sum it with the rest that match within the given dates through textboxes. I am not sure if maybe I am using the criteria or wrong or what but I cant get it to correctly fire. When I do get it to pull the right data it pulls everythin from the Data Table and not just for the requested dates. Anyone have any ideas?



    Thanks in advance,

    Matt

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    What is position A, B, or C - are these fields? If so, sounds like non-normalized data structure. Need something to analyse. Provide the sql of attempted query or follow instructions at bottom of my post to provide db.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    brow1726 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2012
    Posts
    13
    Yes they are fields. I am entering production data for 3 person work stations. But the people in the cell change week to week. So what I want to do with the query is say for the month of august I want to see the number totals for all the people broken down by processor.

    Here is the SQL:

    SELECT Processor.Processor, Sum(TrackingTable.ActualProduction) AS SumOfActualProduction, Sum(TrackingTable.Goal) AS SumOfGoal, Avg(TrackingTable.Percentage) AS AvgOfPercentage
    FROM Processor, TrackingTable
    WHERE (((TrackingTable.Scan)=[Processor]![Processor]) AND ((TrackingTable.EntryDate) Between [Forms]![Queries]![StartDate].[Value] And [Forms]![Queries]![EndDate].[Value])) OR (((TrackingTable.Validation)=[Processor]![Processor])) OR (((TrackingTable.Verification)=[Processor]![Processor]))
    GROUP BY Processor.Processor, TrackingTable.Training
    HAVING (((TrackingTable.Training) Not In ("Yes")));
    Thanks for any help!!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    You want the total per person per processor? I don't see anything in that query and looks like position fields. Use a UNION query to normalize the data.

    SELECT "A" As Position, PositionA AS StaffName, {other fields as desired} FROM tablename
    UNION SELECT "B", PositionB, {other fields as desired} FROM tablename
    UNION SELECT "C", PositionC, {other fields as desired} FROM tablename;

    Now use that query in other queries to summarize, filter, sort, calculate data.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 05-11-2013, 10:14 AM
  2. Display Remaining Units within time frame
    By Stanggirlie in forum Access
    Replies: 3
    Last Post: 01-05-2013, 10:44 AM
  3. Replies: 1
    Last Post: 12-12-2012, 01:50 PM
  4. Calculating age during a specific time frame
    By mommaof4kids in forum Reports
    Replies: 1
    Last Post: 09-06-2012, 06:08 PM
  5. Replies: 0
    Last Post: 04-22-2011, 04:58 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