X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> SQL Count In Totals Function Of Access Adding Totals For 2 Records With Same Plant Number Id But Different Events, Access 2010    
post Sep 16 2019, 06:44 PM

Posts: 5
Joined: 21-March 12

I'm trying to join 2 queries to get a count of docs against a plant# but linked to different events the problem is final query results seems to display aggregate of both records.
Please see attached for details - query

Any help on what am I doing wrong? or How can it be done. Thanks!
Attached File(s)
Attached File  Count_for_Fall_Turaround_for_plant.pdf ( 133.53K )Number of downloads: 9
Go to the top of the page
post Sep 16 2019, 08:21 PM

Posts: 3,364
Joined: 27-February 09

Create the two aggregate queries, and then join them in a third?
For a minute there, I thought you were gonna make our lives easy and include the relevant tables and some data. Nice psych job.
Go to the top of the page
post Sep 17 2019, 06:39 AM

Posts: 20,464
Joined: 10-January 04

> "linked to different events"
you are missing a link on event ... you can add this link line yourself in the query design view by clicking on the appropriate field (tajob_event? event_name?) in the first query and then dragging to that field in the second query and then letting go. Be sure to edit the join line so the arrow points the same as the one already there.
Realize, that since you haven't included the table that defines plant number in the query, that you will only get records that 1qry has.

Because event is not a link, nor is it in criteria, you are getting all events for the plant in the count for each record.

have an awesome day,
Go to the top of the page
post Sep 17 2019, 12:37 PM

Posts: 5
Joined: 21-March 12

Hi guys, thanks for the advice it worked.
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    5th December 2019 - 04:47 PM