COUNT()

I am looking for the code to count unique numbers. There will be a list of transaction numbers, I need to be able to count the ones that have different numbers

Reply to
tommyvcfs
Loading thread data ...

Hi Tommyvcfs - you could try

select count(*) from [transaction]

This will show you the number of rows (records) on your transaction table. Each row is a different transaction where transaction number is the primary key

H> I am looking for the code to count unique numbers. There will be a list of

Reply to
convoluted

that works in the RMS database because the [transaction] table has a unique transactionNumber by definition.

To get a count of unique values in a column where the values can repeat (Item.DepartmentID for example) use this: select count(distinct departmentID) from Item

Or to find out how many occurances of each value there are:

select departmentID, count(*) from item group by departmentID

Glenn Adams Tiber Creek C> Hi Tommyvcfs - you could try

Reply to
Glenn Adams [MVP - Retail Mgmt

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.