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

Should I use a crosstab for this?

I am trying to get the totals of a table by client by type of income.

This query will get what I am looking for with each unique combination
as a row:

SELECT Sales.Client, BillCode.Type, Sum(Sales.Amount)
FROM Invoice_Details INNER JOIN BillCode ON Sales.BillCode =
BillCode.id
GROUP BY Client, Type;

However, what I would like to get is a report that has clients as rows
and the total sales amount for each bill code as columns.

I have tried to do a crosstab but the wizard confuses me more than
helps me.

If this in fact a good time for a crosstab, please show me what it
would look like.

If not, please tell me how to attack this.

I can get it to work with subqueries but the more fields I have, the
more complicated it gets to work with.

Also, can an access table be updated by a crosstab?

Thanks.

Nov 13 '05 #1
7 1891
"ne****@yahoo.com" <New Guy> wrote in message
news:5e********************************@4ax.com...
I am trying to get the totals of a table by client by type of income.

This query will get what I am looking for with each unique combination
as a row:

SELECT Sales.Client, BillCode.Type, Sum(Sales.Amount)
FROM Invoice_Details INNER JOIN BillCode ON Sales.BillCode =
BillCode.id
GROUP BY Client, Type;

However, what I would like to get is a report that has clients as rows
and the total sales amount for each bill code as columns.

I have tried to do a crosstab but the wizard confuses me more than
helps me.

If this in fact a good time for a crosstab, please show me what it
would look like.

If not, please tell me how to attack this.

I can get it to work with subqueries but the more fields I have, the
more complicated it gets to work with.

Also, can an access table be updated by a crosstab?

Thanks.


If I understand correctly....

Use a crosstab query. Go straight to Design View (skip the wizard).
Use the following entries in the grid:

Field - Client
Total - GroupBy
Crosstab - RowHeading

Field - Type
Total - GroupBy
Crosstab - ColumnHeading

Field - Amount
Total - Sum
Crosstab - Value

Good Luck,
Fred Zuckerman

Nov 13 '05 #2
On Fri, 12 Aug 2005 18:58:19 GMT, "Fred Zuckerman"
<Zu********@sbcglobal.net> wrote:
Use a crosstab query. Go straight to Design View (skip the wizard).
Use the following entries in the grid:

Field - Client
Total - GroupBy
Crosstab - RowHeading

Field - Type
Total - GroupBy
Crosstab - ColumnHeading

Field - Amount
Total - Sum
Crosstab - Value

Good Luck,
Fred Zuckerman


Thank you. That was certainly easy.
Nov 13 '05 #3
On Fri, 12 Aug 2005 18:58:19 GMT, "Fred Zuckerman"
<Zu********@sbcglobal.net> wrote:
If I understand correctly....

Use a crosstab query. Go straight to Design View (skip the wizard).
Use the following entries in the grid:

Field - Client
Total - GroupBy
Crosstab - RowHeading

Field - Type
Total - GroupBy
Crosstab - ColumnHeading

Field - Amount
Total - Sum
Crosstab - Value

Good Luck,
Fred Zuckerman


Is it possible to update another table with the results of a crosstab
query?

Thanks.
Nov 13 '05 #4
On Fri, 12 Aug 2005 19:50:58 GMT, "ne****@yahoo.com" <New Guy> wrote:
On Fri, 12 Aug 2005 18:58:19 GMT, "Fred Zuckerman"
<Zu********@sbcglobal.net> wrote:
If I understand correctly....

Use a crosstab query. Go straight to Design View (skip the wizard).
Use the following entries in the grid:

Field - Client
Total - GroupBy
Crosstab - RowHeading

Field - Type
Total - GroupBy
Crosstab - ColumnHeading

Field - Amount
Total - Sum
Crosstab - Value

Good Luck,
Fred Zuckerman

Is it possible to create a table with the results of a crosstab
query?

What would the syntax be?

Thanks.

Nov 13 '05 #5
On Fri, 12 Aug 2005 18:58:19 GMT, "Fred Zuckerman"
<Zu********@sbcglobal.net> wrote:

On Fri, 12 Aug 2005 21:13:29 GMT, New Guy <ne****@yahoo.com> wrote:
On Fri, 12 Aug 2005 19:50:58 GMT, "ne****@yahoo.com" <New Guy> wrote:
On Fri, 12 Aug 2005 18:58:19 GMT, "Fred Zuckerman"
<Zu********@sbcglobal.net> wrote:
If I understand correctly....

Use a crosstab query. Go straight to Design View (skip the wizard).
Use the following entries in the grid:

Field - Client
Total - GroupBy
Crosstab - RowHeading

Field - Type
Total - GroupBy
Crosstab - ColumnHeading

Field - Amount
Total - Sum
Crosstab - Value

Good Luck,
Fred Zuckerman

Is it possible to create a table with the results of a crosstab
query?

What would the syntax be?

Thanks.

After looking around with Google for a while, I found out that you can
change the Query type from Crosstab to Make Table after getting the
crosstab working properly.

However, it did not do what I was trying to get. It gave me a row for
each combination of Client and Type with the sum for each combination.
Multiple rows for each client.

What I would like to get from this is one row for each Client, with a
column for each Type, with the Sum(Amount) for each type in the
columns.

Perhaps this is not what a crosstab does? How can I accomplish this?
Subquery?

Sorry if I did not explain this correctly the first time.

Thanks.
Nov 13 '05 #6
On Fri, 12 Aug 2005 22:54:12 GMT, New Guy <ne****@yahoo.com> wrote:
After looking around with Google for a while, I found out that you can
change the Query type from Crosstab to Make Table after getting the
crosstab working properly.

However, it did not do what I was trying to get. It gave me a row for
each combination of Client and Type with the sum for each combination.
Multiple rows for each client.

What I would like to get from this is one row for each Client, with a
column for each Type, with the Sum(Amount) for each type in the
columns.

Perhaps this is not what a crosstab does? How can I accomplish this?
Subquery?

Sorry if I did not explain this correctly the first time.

Thanks.


It occurred to me to run a Crosstab on the table I created with the
original crosstab. The second crosstab got me what I wanted?

Is there a simpler way?

Thank you.
Nov 13 '05 #7
"New Guy" <ne****@yahoo.com> wrote in message
news:mb********************************@4ax.com...
On Fri, 12 Aug 2005 22:54:12 GMT, New Guy <ne****@yahoo.com> wrote:
After looking around with Google for a while, I found out that you can
change the Query type from Crosstab to Make Table after getting the
crosstab working properly.

However, it did not do what I was trying to get. It gave me a row for
each combination of Client and Type with the sum for each combination.
Multiple rows for each client.

What I would like to get from this is one row for each Client, with a
column for each Type, with the Sum(Amount) for each type in the
columns.

Perhaps this is not what a crosstab does? How can I accomplish this?
Subquery?

Sorry if I did not explain this correctly the first time.

Thanks.


It occurred to me to run a Crosstab on the table I created with the
original crosstab. The second crosstab got me what I wanted?

Is there a simpler way?

Thank you.


Well, you leave the crosstab query the way you had it (with the desired
results). Then create another query. Make the 2nd query a Make Table query
and use the Crosstab query as the source. Thus whenever you execute the 2nd
query, the 1st query will run automatically because it is the source, and
your new table will be created.
Fred Zuckerman
Nov 13 '05 #8

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

Similar topics

1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
4
by: Judy | last post by:
I'm using Access 2003 and was wondering if it is possible to have a paramater selection within a crosstab query so that I wouldn't need to build a new table. I have a select query that I'm using...
8
by: Penny | last post by:
(Access 2003 Multiuser Split DB, Windows XP Pro) Hi All, I would really appreciate just some basic tips on how to make a Crosstab Form based on a Crosstab Query. The query always has the same...
14
by: Tina | last post by:
My employer tracks productivity/performance of clinicians (how much they bill) each week, its averages for the month, and the 6 months. These averages are compared to their expected productivity....
13
by: salad | last post by:
Operating in A97. I didn't receive much of a response conserning Pivot tables in Access. Pivot tables are nice, but a CrossTab will work for me too. Using a Pivot table, one is actually...
0
by: Tom | last post by:
Hi: I'm using a crosstab query to export data to an Excel spreadsheet for further processing. The source of the data for the crosstab is a temporary table. The temp table has 3 fields: *...
4
by: m.wanstall | last post by:
I have a crosstab query that compiles data for Months of the year. I have a stacked select query on top of that crosstab query that uses the latest 2 months data and exports it to a fixed length...
4
by: mattlightbourn | last post by:
Hi all, I have a problem which has been driving me nuts. Crosstab queries! I have a database witch a few different tables to do with garment manufacturing. I have a table for a client...
4
by: Newbie12345 | last post by:
I have a crosstab query which gathers data from a regular table and creates columns for the months in the year with volume for each month. I want to be able export/send the data to a brand new table,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...
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...
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,...

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.