473,396 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Incrementing counter based on results

Hello World,

I'm relatively new to MS Access (2003) and am trying to implement
something that I feel should be simple but cannot find a solution.
Hoping that you can help me or point me where to seek more help.

Let's start with a hypothetical database:

ID Name
1 Peter
2 Paul
3 Paul
4 Paul
5 Simon
6 Simon
7 Mike
8 Mike
9 Mike
10 Mike

This is generated by a query I ran. Now I want to implement a counter
that will go through the "name" column and count the number of times a
specific name appeared. In this case, the result would be Peter - 1,
Paul - 3, Simon - 2 and Mike - 4. The ID column is not necessarily
always incrementing by 1 for the results were filtered from a much
larger database.

Is it possible to implement a counter which only increments if
specific criteria are met?

Thanks in advance for your advice.

Kim

Jul 9 '07 #1
1 1613
<se********@gmail.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
Hello World,

I'm relatively new to MS Access (2003) and am trying to implement
something that I feel should be simple but cannot find a solution.
Hoping that you can help me or point me where to seek more help.

Let's start with a hypothetical database:

ID Name
1 Peter
2 Paul
3 Paul
4 Paul
5 Simon
6 Simon
7 Mike
8 Mike
9 Mike
10 Mike

This is generated by a query I ran. Now I want to implement a counter
that will go through the "name" column and count the number of times a
specific name appeared. In this case, the result would be Peter - 1,
Paul - 3, Simon - 2 and Mike - 4. The ID column is not necessarily
always incrementing by 1 for the results were filtered from a much
larger database.

Is it possible to implement a counter which only increments if
specific criteria are met?

Thanks in advance for your advice.

Kim
Yes, in query design mode click the Totals button. This will reveal another
row on the grid called Total. Set ID to Count and Name to Group By.
Incidentally, don't use Name as a field name, it's a reserved word and might
cause you problems.

Keith.
www.keithwilby.com

Jul 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tom | last post by:
Anyone help on this? PHP/MySQL I have a repeat region displaying records from orders in a CSV format: CalJoe33,18,08/23/2004,FED EX,PREPAID,WEBSITE,CA,Book,25.95,??? CalJoe33,18,08/23/2004,FED...
2
by: Mike Brearley | last post by:
I have a counter (alright one I found on asp101.com) that checks for a session variable to prevent the counter from incrmenting if a user refreshes the page or returns to the page during the same...
6
by: J. Campbell | last post by:
Hi everyone. I'm sure that this is common knowledge for many/most here. However, it was rather illuminating for me (someone learning c++) and I thought it might be helpful for someone else. I'm...
2
by: Paul Brown | last post by:
Thanks for various responses - my feeling is that the cost benefit ratio is now approaching the noise level asymptote, though there was at least one good point : > compressed plain-text copy of...
10
by: Mark A. Sam | last post by:
Hello, I am using Visual Web Developer and decared a Public Variable in the Class section. I assigned a value in the load section, and on a button I set it up to increment, but it always...
27
by: Erik de Castro Lopo | last post by:
Hi all, The GNU C compiler allows a void pointer to be incremented and the behaviour is equivalent to incrementing a char pointer. Is this legal C99 or is this a GNU C extention? Thanks in...
0
by: icezcube | last post by:
I am not a programmer and a newbie with MS Access. I hope you guys can help me with my problem. I'm creating an IT hardware inventory database for my company. We have a few branches and each...
2
by: NJonge01 | last post by:
Hi, I use a counter in a subreport. The subreport is the primary data presentation for the report, and it covers more than 1 page. I use the OnFormat event of the Detail section to...
3
by: Bruno.DiStefano | last post by:
Hi All, BACKGROUND INFO I need to use a "vector" structure to store a number of objects that becomes known only at run time. The constructor, at instantiation time of a new object, increments a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.