Solved

group count

Posted on 2013-11-15
6
308 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
  • 3
  • 2
6 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 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
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.

 
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 500 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

825 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