473,832 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best technique to produce report with data and percentages of thetotal

I need to produce a report like this

Color: # %
------ --- ---
White 10 20
Black 25 50
other 15 30
---- ----
Total 50 100
Data (from summary query)

White 10
Black 25
Other 15

I know you can use computations involving DSUM to calculate the
percentages in a query.

I have also created a summary query of the total then combined that with
each record of the detail so I could always create percentages. (This
is easy to do in Access by including two tables in the query design view
without any relation between them. The result is records having all
combinations.

Combined data
White 10 50
Black 25 50
other 15 50

The percentage is computed from data on each record.

Anyone have another way that is faster or easier???

Bob
Sep 28 '06 #1
1 1696
On Thu, 28 Sep 2006 13:25:46 -0500, Bob Alston <bo********@yah oo.com>
wrote:

In order to calculate the percentages you need the sum of the counts.
DSum may not be the fastest way to get it, if you have a large (>1000
rows) base data set. If so, try a totals query.
Also calling the Totals query or DSum once per row is likely not as
fast as pre-computing it, and passing it into your query as a
parameter.

In T-SQL there is the interesting WITH CUBE clause, but it does not
exist in Access SQL.

-Tom.

>I need to produce a report like this

Color: # %
------ --- ---
White 10 20
Black 25 50
other 15 30
---- ----
Total 50 100
Data (from summary query)

White 10
Black 25
Other 15

I know you can use computations involving DSUM to calculate the
percentages in a query.

I have also created a summary query of the total then combined that with
each record of the detail so I could always create percentages. (This
is easy to do in Access by including two tables in the query design view
without any relation between them. The result is records having all
combinations .

Combined data
White 10 50
Black 25 50
other 15 50

The percentage is computed from data on each record.

Anyone have another way that is faster or easier???

Bob
Sep 29 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1740
by: Mike Partridge | last post by:
Is it possible to access your caller's (not parent) context while inside a <xsl:template match...> or <xsl:for-each...>? Here is the xml I'm using: <report-set> ...<report> .....<detail-data> .......<detail-column position="1" dsc="col1" sum_fg="0"/> .......<detail-column position="2" dsc="col2" sum_fg="1"/> .......<detail-column position="3" dsc="col3" sum_fg="1"/>
6
1784
by: C Albrecht | last post by:
When our users run reports, they don't always produce the same results, even though the data has not changed. We have several large reports containing several subreports. Users can run the report and the report can have a subreport that shows data. They then run it again, and the subreport is empty. No error is produced. The problem is not limited to a specific subreport and can seem to occur anywhere!?! We also have instances...
1
2513
by: Megan | last post by:
quick summary: i'm having problems trying to group fields in a report in order to calculate percentages. to calculate percentages, i'm comparing the results from my grouped fields to the totals. first, let me say that this is a really long post. i wasn't sure how much information/ background to provide, so i thought more was better than less. i tried to delineate certain areas so that it would be easy to peruse my posting and find...
2
2398
by: MattC | last post by:
Hi, I am developing a timesheet system that collects information about employees activities. In this I collect details about projects they do work for, what type of work, how long, when etc etc. For distributed data input/storage and display I am happy using ASP.NET. However ther eis one aspect of the project I am not entirely comfortable with, report production. The requirement is to produce 6 or 7 reports that view certain aspects...
0
1108
by: Dave | last post by:
Hello I have set up a database of students in a program, mainly for statistics. The report I'm having trouble with right now is one that graphs admission rates on a per-term basis. Here's what the report looks like without the graphs (obviously it's a lot better than I can post here, but this is the gist of it): Start Date by Month Status Applications
7
1820
by: matt | last post by:
hello, i have been given a challenging project at my org. i work on an inventory management web application -- keeping tracking of parts assigned to projects. in the past, i built an in-house ASP.NET reporting system. just your standard stuff -- user clicks on a report, the page executes a pre-defined SQL query, a dataset is formed and bound to a data repeater. that works well for us. and using some nifty CSS, my reports look good on...
0
1145
by: Wayne | last post by:
I am trying to create a Report from 1 table but different columns counts with percentages. First column 2nd Column Item1 (Rcrd cnt of Item1) onhand qty = 0 (Percent) Rcrd cnt onhand qty 0 (Percent) Item2 (Rcrd cnt of Item2) onhand qty = 0 (Percent) Rcrd cnt onhand qty 0 (Percent)
24
2203
by: Earl | last post by:
I have all of my data operations in a separate library, so I'm looking for what might be termed "best practices" on a return type from those classes. For example, let's say I send an update from the UI layer to a method in a library class that calls the stored procedure. Best to return a boolean indicating success/failure, return a string with the exception message, or just return the entire exception?
2
1653
by: Bob Alston | last post by:
Recently I have been helping a nonprofit modify a system built in Access, that they acquired from another nonprofit. I am doing this as a volunteer. I would like your perspective on two techniques I found in use as compared to the technique I typically use. Report Parameters ---------------- One thing I noticed is that the developer used a reports parameter form,
0
9795
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
10780
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...
1
10540
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,...
0
10212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9319
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7753
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
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4421
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3077
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.