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

I Surrender- Issue working out set diffing information sets from one table

Ok Guys here the issue!
I can do this task using 3 crosstabs individually but:-

I have to report information on multiple training programmes. Each report is setup for periods 1 to 12 (period = 1 per month)

Crosstab 1 reports quantities of people starting training each period

Crosstab 2 reports quantities of people leaving training each period

Crosstab 3 reports quantities of people achieving their training programme for each period.

As stated I can do this by running each crosstab. I have to try and consolidate this system so that either through SQL or another process I can do the job.
Any advice from anyone who may have done something similar in the past??
Gareth
May 8 '07 #1
3 1188
Rabbit
12,516 Expert Mod 8TB
Is this for a report? You can use subreports.

But if you want it all in one query I suppose you could use a union query, as long as the columns are all the same name and you have a row field to determine which row of records corresponds to which crosstab.
May 8 '07 #2
JConsulting
603 Expert 512MB
create a select query for each of your crosstabs. For a union...the number of fields output for each member has to match.

then paste the SQL into a final query so that it resembles this.

SELECT 'firstCrosstab' as Source,[_Answers_Crosstab].UserID, [_Answers_Crosstab].[Total Of ID], [_Answers_Crosstab].[1], [_Answers_Crosstab].[2], [_Answers_Crosstab].[5]
FROM _Answers_Crosstab
union all
SELECT 'SecondCrosstab' as Source,[_Answers_Crosstab].UserID, [_Answers_Crosstab].[Total Of ID], [_Answers_Crosstab].[1], [_Answers_Crosstab].[2], [_Answers_Crosstab].[5]
FROM _Answers_Crosstab
union all
SELECT 'ThirdCrosstab' as Source,[_Answers_Crosstab].UserID, [_Answers_Crosstab].[Total Of ID], [_Answers_Crosstab].[1], [_Answers_Crosstab].[2], [_Answers_Crosstab].[5]
FROM _Answers_Crosstab;

J
May 8 '07 #3
JConsulting
603 Expert 512MB
create a select query for each of your crosstabs. For a union...the number of fields output for each member has to match.

then paste the SQL into a final query so that it resembles this.

SELECT 'firstCrosstab' as Source,[_Answers_Crosstab].UserID, [_Answers_Crosstab].[Total Of ID], [_Answers_Crosstab].[1], [_Answers_Crosstab].[2], [_Answers_Crosstab].[5]
FROM _Answers_Crosstab
union all
SELECT 'SecondCrosstab' as Source,[_Answers_Crosstab].UserID, [_Answers_Crosstab].[Total Of ID], [_Answers_Crosstab].[1], [_Answers_Crosstab].[2], [_Answers_Crosstab].[5]
FROM _Answers_Crosstab
union all
SELECT 'ThirdCrosstab' as Source,[_Answers_Crosstab].UserID, [_Answers_Crosstab].[Total Of ID], [_Answers_Crosstab].[1], [_Answers_Crosstab].[2], [_Answers_Crosstab].[5]
FROM _Answers_Crosstab;

J
results look thusly

Source UserID Total Of ID 1 2 5
firstCrosstab 0 2 3 1 2
SecondCrosstab 0 2 3 1 2
ThirdCrosstab 0 2 3 1 2
May 8 '07 #4

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

Similar topics

2
by: BjoernJackschina | last post by:
Hello, I have this source code but I want to prevent the call for the next page when the function is false. How could I do this? The function 'ueberpruefen' has a surrender value(true or false)....
6
by: Hal Vaughan | last post by:
I've been reading up on file permissions (including FilePermission, Permission, and Permissions). From what I see, these are temporary and forgotten when a program exits (if I'm wrong, tell me,...
29
by: Mercury Mercurius | last post by:
Please help - I'm at my wits' end.... I'm getting two different placements of some content wrapped in a <span> tag in Netscape and Internet Explorer (big surprise!). I prefer how the page looks in...
72
by: gamehack | last post by:
Hi all, I was thinking today, suppose we have the number n = 0xAB 0xFF which is equivalent to 44031 in decimal. In big endian it will be stored as 10101011 11111111 but in little endian...
13
by: oliv | last post by:
Bonjour, Je cherche le moyen d'utiliser une variable d'environnement dans les "Additional include directories" sous Visual C++ 6.0 mais je ne connais pas la syntaxe à utiliser. J'ai essayé...
0
by: guest1 | last post by:
seems to be a problem in my first case stmt here i need to convert this and i dont know how, hope somebody can help me out select distinct top 10 tplan.plan_long_nm, asset.ast_cntr_pol_num,...
0
by: 88059355 | last post by:
Let go of outdated belief systems,There are SIMPLE and EFFECTIVE Tools to Deal with Worry! I know most of you already know that worry is useless. Worry takes us out of the present moment, where...
6
by: czi02 | last post by:
this is my vb6.0 combo1 combo2 and a two listbox the 1st listbox had a text. then the secong one If I run the project I will type the text that has written in the 1st listbox.
2
by: czi02 | last post by:
Hi there: Im making a speedtest project. for example: I had two options: the 1min and 2min in the combo box. I had two listbox. The first listbox, I had a text that I ahb deen encode. Then the 2nd...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.