Count in a query problem

  • Thread starter Thread starter Mike B
  • Start date Start date
M

Mike B

I have a query that is looking a table of part numbers.
I want to be able to see how many times each part number is in the table.

I created a new field called CountPart:[ODPART]
Turned on the Totals function.
And have the field ODPART with GroupBy.

Put all I get is 1 in the CountPart field.

What have I done wrong?
Or
Is there a better way of doing this.


My end result is to find all the part number that have been ordered more
than three times. If I can get the count field to works with the right
value. Then I can select on that field for >=3 and get just the part number
I want.

Thanks for the help,
Mike
 
Did you put Count under CountPart:[ODPART] on the Totals Row?

Your SQL should look like this:
Select ODPart, Count(ODPart) As CountPart
From YourTableName
Group By OdPart
Having Count(ODPart) >= 3

Hope that helps!


Mike said:
I have a query that is looking a table of part numbers.
I want to be able to see how many times each part number is in the table.

I created a new field called CountPart:[ODPART]
Turned on the Totals function.
And have the field ODPART with GroupBy.

Put all I get is 1 in the CountPart field.

What have I done wrong?
Or
Is there a better way of doing this.


My end result is to find all the part number that have been ordered more
than three times. If I can get the count field to works with the right
value. Then I can select on that field for >=3 and get just the part number
I want.

Thanks for the help,
Mike
 
Thanks, worked great.
Life saver I needed this report complete tomorrow for a meeting.

Thanks again.
Mike

~~~~~~~~~~~~~~~~~~`




Jeff L said:
Did you put Count under CountPart:[ODPART] on the Totals Row?

Your SQL should look like this:
Select ODPart, Count(ODPart) As CountPart
From YourTableName
Group By OdPart
Having Count(ODPart) >= 3

Hope that helps!


Mike said:
I have a query that is looking a table of part numbers.
I want to be able to see how many times each part number is in the table.

I created a new field called CountPart:[ODPART]
Turned on the Totals function.
And have the field ODPART with GroupBy.

Put all I get is 1 in the CountPart field.

What have I done wrong?
Or
Is there a better way of doing this.


My end result is to find all the part number that have been ordered more
than three times. If I can get the count field to works with the right
value. Then I can select on that field for >=3 and get just the part
number
I want.

Thanks for the help,
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top