472,353 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 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 1787
"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...
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...
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...
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...
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...
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...
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...
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...
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...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.