Help with a query.....

carl6885

Registered User.
Local time
Today, 11:01
Joined
Nov 16, 2011
Messages
82
Hi

I have a database that deals in logging errors within a company department. As part of this I want to add some trend analysis.

In the logging form a user can select two causing areas.

it is possible bonds might the team causing in any order or the team causing for both options.

What I need is to get the number of times an error category has been logged by this area which I have managed to do..... my problem is the query is returning duplicate categories what I need is the overall number for each catergory.

This is what is returned..... query below it.

BreachType CountOfBreachType
DPA 6
DPA 3
DPA - Info sent to the wrong address 1
DPA - Unauthorised release of info 1
DPA - Unauthorised release of info 1
Interdepartmental / Procedural delay 1

Query

SELECT tblBreach.BreachType, Count(tblBreach.BreachType) AS CountOfBreachType
FROM tblBreach
GROUP BY tblBreach.BreachType, tblBreach.AreaCaused1, tblBreach.AreaCaused2
HAVING (((tblBreach.AreaCaused1)="bonds")) OR (((tblBreach.AreaCaused2)="bonds"));

Hopefully you can see me problem, there shouldn't be any duplicates.....

Any help would be appreciated.

Thanks

Carl
 
Sorted it....... I think.

I have to do a query on a query. Or at least its having the desired affect!

I first created a query to bring in all the errors for the particular area concerned, once that was right I then created another query on that one grouping and counting the error type.
 

Users who are viewing this thread

Back
Top Bottom