473,795 Members | 3,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subtotal in queries using Access 2003

55 New Member
Hello all,

Does anyone have any code that will subtotal a query in Access?

Thank you.
BEFORE:

Account Code Principal Income
4 BUY $10.00 $0.00
4 BUY $10.00 $0.00
4 BUY $10.00 $0.00
4 BUY $10.00 $0.00
5 BUY $10.00 $0.00
5 BUY $10.00 $0.00
5 BUY $10.00 $0.00
5 BUY $10.00 $0.00
5 BUY $10.00 $0.00
4 Sell $5.00 $613.89
4 Sell $5.00 $4,472.22
4 Sell $5.00 $0.00
4 Sell $5.00 $0.00
4 Sell $5.00 $0.00
5 Sell $151.00 $6,666.67
5 Sell $15.00 $0.00
5 Sell $23.00 $10,000.00
5 Sell $44.00 $16,808.36
5 Sell $55.00 $15,694.44



I want my data to look like this:

Account Code Principal Income
4 BUY $10.00 $0.00
4 BUY $10.00 $0.00
4 BUY $10.00 $0.00
4 BUY $10.00 $0.00
4 Subtotal $40.00 $0.00
5 BUY $10.00 $0.00
5 BUY $10.00 $0.00
5 BUY $10.00 $0.00
5 BUY $10.00 $0.00
5 BUY $10.00 $0.00
5 Subtotal $130.00 $0.00
4 Sell $5.00 $613.89
4 Sell $5.00 $4,472.22
4 Sell $5.00 $0.00
4 Sell $5.00 $0.00
4 Sell $5.00 $0.00
4 Subtotal $25.00 $5,086.11
5 Sell $151.00 $6,666.67
5 Sell $15.00 $0.00
5 Sell $23.00 $10,000.00
5 Sell $44.00 $16,808.36
5 Sell $55.00 $15,694.44
5 Subtotal $338.00 $59,341.69
Mar 31 '08 #1
1 3255
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Hi. Access reports will do what you ask in the format you require, which is

Acc 1 detail 1
Acc 1 detail 2
Acc 1 detail 3
Acc 1 subtotal

Acc 2 detail 1
Acc 2 detail 2
Acc 2 subtotal

and so on.

You would group the data by account code, show the individual rows in the detail section of the report, and place totals in the group footer.

A basic report can be created using the report wizard and customised to your requirements thereafter.

-Stewart
Apr 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
2357
by: Marco Alting | last post by:
Hi, I'm still confused about my queries, I want to do something is ASP that is easily done in Access. I'll post the Access queries below as a reference. The main idea is that the queries depend on each other in a hierarchical manner. It all works fine in Access, but in the last query (Qrylevel3CostTotals) there's a criteria which I would like to set from an HTML form and thats where I am confused! How do I make this work in an ASP...
6
6786
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used the SQL Profile to watch the T-SQL-Command which Access ( who creates the commands?) creates and noticed:
4
2026
by: dschl | last post by:
Hi, I'm converting an Access 2000 database to Sql Server and must be missing something obvious. Using the Import utility in Sql Server, the Access queries seem to get executed and the resultant data imported as tables. Oops! Using the Upsize lizard in Access 2003, the queries aren't even in the selection list of "tables" to upsize. It looks like the Upsize wizard
6
2118
by: Brad | last post by:
I have an sql query that has specific criteria (like state='PA' or state = 'NJ'...) and would like to be able to have the user specify the criteria dynamically either through the web or from MSAccess or another tool. The query also does a GROUP BY the state and other variables that are part of the criteria. I know how to get MSAccess and asp pages to do the sorting and selecting against an SQL tbl or view, but when access queries the...
5
4044
by: Jerry Hull | last post by:
I'm working with a database developed by an untrained person over several years - and on a network that has recently been upgraded with a new server installed and MS office upgraded from 2K (I think - it might have been XP) to 2003. The database is impressive, both in what it does and the obtuse and inconsistent ways it works. There are several hundred queries, for example, with no indication of where they are used or if they are in fact...
5
3978
by: mebrabham | last post by:
Hello, I am trying to create a running subtotal in a query and then graph the running subtotal for each city group. The data looks like this in the table (for illustration): My City My Date Cumulative Sum Daily Sum DC 03-Apr-07 6 6 DC 04-Apr-07 20 14 DC 05-Apr-07 0 0 DC 06-Apr-07 24 4
3
2558
prn
by: prn | last post by:
Hi folks, I'm trying to create letters based on an Access database. I'm using Access 2003 and Word 2003. Most of the data tables are actually on a SQL server and Access is the front end for them. I have the boilerplate for my letter ready. Now, with Access open and connected to the SQL server, I open Word with the file I want, click "Tools", "Letters and Mailings" and select MailMerge. Word allows me to select the document type, with...
1
3247
by: tam76131 | last post by:
Hello, I'm very new to access and have been struggling with the subtotal function in access. I have a very large table with the following info State City ID Month First Last Shoes Hats MISC Total WA Seattle 123 01/2007 John Doe 1 5 2 WA Seattle 123 01/2007 John Doe 1 5 2 NY NY 132 01/2007 Jane...
2
1950
by: murch.alexander | last post by:
Hi all, I have a query that uses a subquery to subtotal one of its fields. This part is working fine. The twist is that when I encounter certain values, I want to reset the subtotal to zero and continue on. So, it's possible that out of 100 records, I might reset the subtotal to zero 20 times. I can do this in a report but I need it in query form so I can run it automatically when users log in to let them know if the subtotal has
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10436
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.