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 October 2nd, 2003, 06:59 PM
Authorized User
 
Join Date: Aug 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default calculation in VB

hi.. I really new in VB and have one question...

             Item No. and Quantity DateIn
               A 20 03/03/03
               B 10 03/03/03
               A 10 04/03/03
               C 5 05/03/03

* How to get a total for each item? eg. Item A should be = 30

I try to use sum but there are no sum operator in VB...

thank you for your time!
 
Old October 3rd, 2003, 05:04 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do it whithin the Access query using something like this

SELECT DISTINCTROW MyTable.[Item No], Sum(MyTable.Quantity) AS [Sum Of Quantity]
FROM MyTable
GROUP BY MyTable.[Item No];

Where MyTable is the name of the table you are using.

Follow the query wizard and select simple query. Play with it for a while.






Sal





Similar Threads
Thread Thread Starter Forum Replies Last Post
xsl calculation elayaraja.s XSLT 3 July 31st, 2008 04:59 AM
Report Calculation mateenmohd Access 9 December 7th, 2006 03:41 AM
Calculation Grantm Access 3 February 16th, 2004 10:14 AM
calculation in VB semooth Beginning VB 6 1 December 10th, 2003 09:07 AM
calculation in VB semooth VB Databases Basics 4 October 6th, 2003 11:19 PM





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