Struggling to Count data

kevnaff

Member
Local time
Today, 02:33
Joined
Mar 25, 2021
Messages
174
Hi All.

I have the below query which selects data and then counts the number of records that fits the criteria. The criteria is that the Equipment's Owner Department is 'Equipment Pool' and location is 'Equipment Pool'.

Working query

Query1.JPG
Query2.JPG



I now want to be able to count the records where the criteria is Owner Department is 'Equipment Pool' but the location is NOT LIKE 'Equipment Pool'. When I enter this criteria, I get the below results, where the Devtype for each location shows. I don't need to know the location, only the count of devtypes that are NOT LIKE 'Equipment Pool'.

So for Example, the result I want for the first line is...

Devtype CountofLocation
BED ELECTRIC DRIVEN 10

The value of 10 comes from the 7 located in 1A, 1 located in 2A and 2 located in 5C.

Query3.JPG
Query4.JPG


Is there a way to get this from the query, or do I need to create another query to add up these values?

Thanks in advance.
 
Not sure I understand your question, but it appears that all you need to do is uncheck the Location field in the QBE...?
 
Not sure I understand your question, but it appears that all you need to do is uncheck the Location field in the QBE...?

Thanks for the reply.

If I uncheck the location field, I get this...

1719234106067.png



What I want to do is combine the records where each device type appears more than once so it would look like this...

BED ELECTRIC DRIVEN 10
BED PLINTH ELECTRIC 1
DOCKING STATION 1
DOPPLER VASCULAR 2

If that makes sense?
 
If you want to count the DevType, than change the Count to that field and not the Location.
 
Thanks for the reply.

If I uncheck the location field, I get this...

View attachment 114659


What I want to do is combine the records where each device type appears more than once so it would look like this...

BED ELECTRIC DRIVEN 10
BED PLINTH ELECTRIC 1
DOCKING STATION 1
DOPPLER VASCULAR 2

If that makes sense?
Can you upload a zipped copy of your Database?
 
For your second query you need to remove location or use a criteria such as =[location] which will always return true
 
If you want to count the DevType, than change the Count to that field and not the Location.

I tried this too, when I count the DevType, I got the same results.

1719235251350.png

1719235282833.png


I have just created a new query to look at the results of the initial query and have managed to get the data I require.

1719235568223.png
1719235605946.png
 
Thanks for the reply.

If I uncheck the location field, I get this...

View attachment 114659


What I want to do is combine the records where each device type appears more than once so it would look like this...

BED ELECTRIC DRIVEN 10
BED PLINTH ELECTRIC 1
DOCKING STATION 1
DOPPLER VASCULAR 2

If that makes sense?
You would group by DevType.
 

Users who are viewing this thread

Back
Top Bottom