Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 17th, 2003, 11:16 AM
Con Con is offline
Registered User
 
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Grouping and Counting records

I have these records:
 Name Code
 Jane 309.5
 Sam 411.2
 Jay 201
 Sunny 522.3
 Claire 411.2
 June 201
 Max 201
 Sue 309.5
 Sue 411.2
 Jay 522.3
 Kay 201
 John 201

I want a summary of those records in the following manner:
 Code Count
 309.5 2
 411.2 3
 201 5
 522.3 2

Can someone please show me how to query this in Access to get the result that I wanted. Your help is greatly appreciated. Thanks a million.
 
Old September 17th, 2003, 11:31 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Create a new query in SQL View and paste this in the window:

SELECT tblGroup.Code, Count(tblGroup.Code) AS CountOfCode
FROM tblGroup
GROUP BY tblGroup.Code
WITH OWNERACCESS OPTION;

Change tblGroup (everywhere it appears) to your table name.

Regards,

Beth M





Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting Child Records BrianWren VB Databases Basics 1 June 2nd, 2008 04:32 PM
Counting 'groups' of records in a report Odeh Naber Access 4 July 30th, 2007 10:41 AM
AbsolutePosition counting filtered records Brad_S VB Databases Basics 1 August 17th, 2006 04:24 AM
Counting records Jonas Access 4 August 4th, 2006 09:07 AM
A Cursor counting records chubnut SQL Server 2000 12 July 8th, 2004 01:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.