473,320 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Counting in Query

My data looks like:
Model: SerialNu. Failure: Problem: Correction:
T50 343X4 34 Cooler Repair
T55 85B10 34 Downline Replace
T50 345F2 34 Cooler Repair
T50 322A6 19 Pump Replace
T55 84A45 34 Cooler Repair

My query for Failure comes out like this:
34 Cooler Repair
34 Cooler Repair
34 Cooler Repair
34 Downline Replace

Which is okay, the techs can see that the cooler causes failure 34 more that
the Downline.

I would like the query to COUNT the records:
34 Cooler Repair 3
34 Downline Replace 1

Any ideas?

Email okay.

Thanks

Alan
Nov 12 '05 #1
2 1343
You need a group by query. It will be something like this:

SELECT Failure, Problem, Correction, Count(*) As Total
FROM MyDataTable
GROUP By Failure, Problem, Correction

--
Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast
"AAMoy" <aa***@aol.com> wrote ...
My data looks like:
Model: SerialNu. Failure: Problem: Correction:
T50 343X4 34 Cooler Repair
T55 85B10 34 Downline Replace
T50 345F2 34 Cooler Repair
T50 322A6 19 Pump Replace
T55 84A45 34 Cooler Repair

My query for Failure comes out like this:
34 Cooler Repair
34 Cooler Repair
34 Cooler Repair
34 Downline Replace

Which is okay, the techs can see that the cooler causes failure 34 more that
the Downline.

I would like the query to COUNT the records:
34 Cooler Repair 3
34 Downline Replace 1

Any ideas?

Email okay.

Thanks

Alan

Nov 12 '05 #2

U¿ytkownik "AAMoy" <aa***@aol.com> napisa³ w wiadomo¶ci
news:20***************************@mb-m15.aol.com...
My data looks like:
Model: SerialNu. Failure: Problem: Correction:
T50 343X4 34 Cooler Repair
T55 85B10 34 Downline Replace
T50 345F2 34 Cooler Repair
T50 322A6 19 Pump Replace
T55 84A45 34 Cooler Repair

My query for Failure comes out like this:
34 Cooler Repair
34 Cooler Repair
34 Cooler Repair
34 Downline Replace

Which is okay, the techs can see that the cooler causes failure 34 more that the Downline.

I would like the query to COUNT the records:
34 Cooler Repair 3
34 Downline Replace 1

Hi!

I'm not exactly surre if it'll work, but you may try this:

select [Failure], [Problem], [Correction], Count([Problem]) as 'Number of
problems'
from Your_Table
group by [Problem], [Failure], [Correction]

Regards, Leon!
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Chad Reid | last post by:
Hello, I have a bit of code that obviously doesn't work, but I need help creating a query that would have the same effect as if this query was working. SELECT * FROM (SELECT Count(*) AS...
2
by: Glenn Cornish | last post by:
I have 5 fields in a table into which numbers between 1 and 45 can be entered. What I am having trouble with is being able to find out is how many times a particular number appears, regardless of...
4
by: Alicia | last post by:
I am having a problem grouping by week. I am looking for the simpliest way of doing it in Microsoft Access. I have tried to use a pre-loaded calender, access did not like it at all. If there is...
3
by: Megan | last post by:
hi everybody- i'm having a counting problem i hope you guys and gals could give me some help with. i have a query that retrieves a bevy of information from several different tables. first let...
6
by: dixie | last post by:
I have a text field on a form which has names with a comma between them like this: 'J. Smith, A. Jones, A. Man, J. Johns'. I am trying to find a procedure that will count the number of people in...
5
by: ChadDiesel | last post by:
Hello Again, I want to assign a number to each record that will be part of a shipping number. I want the number value to count up until the contract number changes. Then, I want the number to...
18
by: ChadDiesel | last post by:
I appreciate the help on this group. I know I've posted a lot here the last couple of weeks, but I was thrown into a database project at my work with very little Access experience. No other...
4
by: MLH | last post by:
MyString = "All men are created equal" Debug.PrintLen(MyString) Now that's easy. But how about just counting the letter "e"? Or, if I were curious to know how many commas were in the string....
7
by: mwang | last post by:
I have sql like this: select count(*) from TRANSACTION transaction0_ where transaction0_.CREATED > sysdate - 10 and exists (select lineItem.TRANSACTION_ID from LINEITEM lineItem where...
1
by: zufie | last post by:
When I try to count the number of checkboxes containing a check inside I receive a negative number (-1) for each checked checkbox. This is in a query. What can I do to change my query so that a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.