Solved

group count

Posted on 2013-11-15
6
306 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 119

Accepted Solution

by:
Rey Obrero 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 119

Expert Comment

by:Rey Obrero
ID: 39651765
what do you mean, running count? post an sample result.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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 119

Assisted Solution

by:Rey Obrero
Rey Obrero 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now