Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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
  #1 (permalink)  
Old March 28th, 2005, 04:16 AM
Authorized User
 
Join Date: Mar 2005
Location: , , Malaysia.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default sum

hi,
I have a table with 2 fields here : ID , Number
how can i sum up the Number where by the ID is the same in a query?

For example:

ID Number
------- -------
A 5
B 2
C 1
A 3
C 2

the result I want is:

ID Number
------- --------
A 8
B 2
C 3

Thanks in advance ...


  #2 (permalink)  
Old March 28th, 2005, 04:26 AM
Authorized User
 
Join Date: May 2004
Location: Bucharest, , Romania.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try writing/pasting this code into a query (SQL view)

SELECT ID, SUM(Number) FROM 'table name'
GROUP BY ID

Actually you can see the design view afterwards.
Mihai

  #3 (permalink)  
Old March 28th, 2005, 09:42 PM
Authorized User
 
Join Date: Mar 2005
Location: , , Malaysia.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Mihai B , i got it




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sum satish_baleri XSLT 6 October 24th, 2007 03:43 AM
how to sum in for-each Gjella XSLT 1 October 2nd, 2006 08:48 AM
Help: Running Sum (or Cumulative Sum) timdasa VB Databases Basics 1 August 22nd, 2006 03:12 PM
need sum help! jbik BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 December 20th, 2004 05:27 PM
SUM or What bertlf Pro VB Databases 2 November 29th, 2003 02:44 PM





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