Link to home
Start Free TrialLog in
Avatar of Svgmassive
Svgmassive

asked on

running count of unique values in a ms access report

I have a table that has a list of numbers that i would like to display a running count of unique value in a ms access report, this report has no grouping levels which makes it a bit challenging.Thanks
Database1.accdb
Avatar of etech0
etech0
Flag of United States of America image

For a list of unique values:

SELECT DISTINCT fieldName FROM tableName;

For a count of unique values:

SELECT Count(*) AS N
FROM
(SELECT DISTINCT fieldName FROM tableName) AS T;
Avatar of Rey Obrero (Capricorn1)
is this what you are looking for

SELECT dbo_itemx.Sequencenumber, Count(dbo_itemx.Sequencenumber) AS CountOfSequencenumber
FROM dbo_itemx
GROUP BY dbo_itemx.Sequencenumber;

or maybe this is what you need

SELECT Q.Sequencenumber,
(select count(*) from
(SELECT dbo_itemx.Sequencenumber
FROM dbo_itemx
GROUP BY dbo_itemx.Sequencenumber
)  as Q1 where Q1.SequenceNumber<=Q.SequenceNumber) AS Expr1
FROM
(SELECT dbo_itemx.Sequencenumber
FROM dbo_itemx
GROUP BY dbo_itemx.Sequencenumber
) as Q;



it will help if you post a desired outcome/output
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Svgmassive
Svgmassive

ASKER

fyed that's what i am looking,but a strange this is happening if i hide the control and hide duplicates the count is not correct.i just need it to display a total in the page footer per page