473,395 Members | 1,652 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,395 software developers and data experts.

Subtotal in queries using Access 2003

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 3222
Stewart Ross
2,545 Expert Mod 2GB
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
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...
6
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...
4
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...
6
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...
5
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...
5
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...
3
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....
1
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 ...
2
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...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.