?
Solved

group count

Posted on 2013-11-15
6
Medium Priority
?
312 Views
Last Modified: 2013-11-17
I am trying to enter a group count by order to the id ascending.file attached.thanks
Database11.accdb
0
Comment
Question by:Svgmassive
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 39651731
try this query

SELECT dbo_Log.ID, dbo_Log.Sequencenumber, (select count(*) from dbo_log as d where d.id<=dbo_log.id and d.Sequencenumber=dbo_log.Sequencenumber) AS Expr1
FROM dbo_Log
ORDER BY dbo_Log.ID;
0
 

Author Comment

by:Svgmassive
ID: 39651749
capricorn that great if i want to do a running count how would i do that?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39651765
what do you mean, running count? post an sample result.
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 30

Expert Comment

by:hnasr
ID: 39651891
Check:
SELECT a.Sequencenumber, a.ID, (Select count(ID) from dbo_Log b where b.Sequencenumber=a.Sequencenumber and b.ID<=a.ID) as seq_group
FROM dbo_Log a
order by a.Sequencenumber, a.ID;

Open in new window

0
 

Author Comment

by:Svgmassive
ID: 39651900
sequential numbers
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 2000 total points
ID: 39651924
see if this is waht you want


SELECT dbo_Log.ID, dbo_Log.Sequencenumber, (select count(*) from dbo_log as d where d.id<=dbo_log.id and d.Sequencenumber=dbo_log.Sequencenumber) AS Expr1, (select count(*) from dbo_log as d where d.id<=dbo_log.id) AS Expr2
FROM dbo_Log
ORDER BY dbo_Log.ID;
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question