473,465 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Create a report based on multiple queries, totals only, no records

1 New Member
Hi there,

I want to create an output that would automatically display the results (totals only, no records) of multiple queries - more specifically, these queries all draw from the same table, but have several combinations of multiple combinations of values within different fields (e.g. query 1 - field A = 'a' or 'b' and field b = 'x' or 'y' or 'z'; query 2 - ...etc). Because of the complexity of the queries, a cross-tab or pivot table isn't ideal as I would still need multiple pivots, and then do some manual addition. As it is, I have a few different queries in which I change one of the query fields several times, then take the totals from each run and put them into a separate table...tedious! :)

Please let me know if there is any way to create such a report. I am using Access 2010.

Thank you for your help!

Andrea
Jan 16 '12 #1
3 2823
pod
298 Contributor
I am not entirely certain I understand you completely but if it is in the querying itself you need help, here goes nothing:
Expand|Select|Wrap|Line Numbers
  1. select 
  2.   sum(a) as tot_a, 
  3.   sum(b) as tot_b, 
  4.   sum(c) as tot_c
  5. from 
  6. (
  7.   select sum(val) as a, 0 as b, 0 as c
  8.   from  table1 where txt = 'a'
  9. union 
  10.   select 0 as a, count(val) as b, 0 as c
  11.   from  table1 where txt = 'b'
  12. union 
  13.   select 0 as a, 0 as b, sum(val) as c
  14.   from  table1 where txt = 'c' 
  15. )
  16.  
...
of course, you will put in your more complicated code where needed.

I'm sure someone else might show better tricks but I use 0 as spacers, and it works just the same
Jan 16 '12 #2
C CSR
144 New Member
One possibilty may be to stack your queries providing a field for results from each separate query (e.g., Results = Q5(Q4(Q3(Q2(Q1). It looks like a function in a function, but each set of results are actually separated by commas in the final statement. I've done it before, but let me think about it...
Jan 16 '12 #3
NeoPa
32,556 Recognized Expert Moderator MVP
Andrea, you need to give a clearer question if you want help with it. You omit even to include what type of totals you're trying to work with. I'm sure if you gave it some thought you could come up with something that makes clearer sense.
Jan 16 '12 #4

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

Similar topics

3
by: Gord | last post by:
I would like to create a summary report from the results of 11 queries (based on 2 tables). All the queries have the same format and return 3 numbers (Count, Current Year Bal, Last Year Bal.)...
1
by: aayushi22 | last post by:
Hi Need your expert help on the following i have a table with the following records EMP ID Req No Candidate name 1 candidate status 1 candidate name 2
3
by: wsox66 | last post by:
I am new to Access and need some help building a report. I have looked through previous posts on reports but none of them seem to answer my question completely. I am using Access 2003 and I have...
2
by: devindersingh1984 | last post by:
hello sir i am making a project in ms access it is having two tables that is interrelated with primary key. i want to get report of current record means report should take data from both tables....
5
prn
by: prn | last post by:
Hi folks, I'm looking for a little advice here. I need to create a report that is totals only, with no detail records. I have a database with a lot of individuals (people) and the report has to...
2
by: kfboren | last post by:
I am wondering if someone can help me. I have created 10 tables, 10 queries for the tables and 10 reports from the quearies. The creteria for the queries is the field named "month". I have created...
5
by: Brett | last post by:
Hello, Is it possible to have just one criteria and have it apply to a group of queries? I am trying to create a report with the separate results of 4 queries based on a prompt for the user...
3
by: Brett Barry: Go Get Geek! | last post by:
Hello, I just started using Access 2007 after using Access 2003 for a long time. I've created all my queries and they work fine. However, either I forgot or it has changed but, how do I create a...
4
by: BigMac4 | last post by:
Ok i am going to sound like the novice i am but i am hoping that someone will take pity on me and help me out. Here is what i am trying to acheive: I have a report that i need to run using a...
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
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
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...
0
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.