Count

dadrew

Registered User.
Local time
Today, 13:59
Joined
Sep 15, 2003
Messages
186
Is there a way that I can count the amount of times an item has been selected from a Combo Box in a number of records. The purpose of this is to enable me to turn that information into a chart.
 
Do you mean you are selecting a value from a combo box and storing that value in a record? Can you post your db?
 
Yes thats exactly what I mean! I then want to count how many times that particular Item has been selected.
 
Try this query

Code:
SELECT Table.CombovalueField, Count(1) AS Count
FROM Table
GROUP BY Table.CombovalueField;
 
Where you have ComboValueField is that the name of the Combo Box?
 
ComboValueField is the name of the field in your table where you store the value chosen in the combobox for each record i.e. the control source of the combobox on your form, not the name of the combobox.
If you are still struggling, if you post your database I'll be able to write the query with your field names etc. :)
 
OK give us a couple of minutes just to try and work it out. It the meantime thanks!
 
OK the name of the Table is Technical_Incident_Report1 the name of the field within the table that will hold the value is Fault. Therefore as I read it I should be writing this:

SELECT Technical_Incident_Report1.Fault, Count(1) AS Count
FROM Technical_Incident_Report1
GROUP BY Technical_Incident_Report1.Fault;
 
OK its counting the amount of time each oneis listed, but I now need to know how to convert that information into a percentage
 

Users who are viewing this thread

Back
Top Bottom