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

Crosstab query help

32
I need help with a crosstab query. I would like the column headings to be the last 6 months, the row headings to be billers, and the data in the middle to be both the date that a payment was made (falling within the month headings) and also the amount paid in that payment. Sometimes there might be more than one payment to a biller in a month or there might be no payments to that biller in a month. All of the raw data needed is in one table. I have read about crosstab queries, tried to use the wizard, and looked at examples but I can't get it to work . Could someone show me how this should be written?

Something like this is what I need:

_____________Jan_____________Feb___________Ma r__________Apr

Power.............1/3....200..............2/4...250.............3/7....225.........4/5.....250

Lease.............1/15...1200..........2/15...1200..........3/16..1200.......4/20...1200

Insurance.......1/16...175.............2/20...175...................0.....................0
.................................................. 2/26...350

Water/Gas.......1/6...150.............2/10...175...........3/3...150..........4/10...175

Thanks a lot...
May 31 '07 #1
4 1941
Lysander
344 Expert 100+
I need help with a crosstab query. I would like the column headings to be the last 6 months, the row headings to be billers, and the data in the middle to be both the date that a payment was made (falling within the month headings) and also the amount paid in that payment. Sometimes there might be more than one payment to a biller in a month or there might be no payments to that biller in a month. All of the raw data needed is in one table. I have read about crosstab queries, tried to use the wizard, and looked at examples but I can't get it to work . Could someone show me how this should be written?

Something like this is what I need:

_____________Jan_____________Feb___________Ma r__________Apr

Power.............1/3....200..............2/4...250.............3/7....225.........4/5.....250

Lease.............1/15...1200..........2/15...1200..........3/16..1200.......4/20...1200

Insurance.......1/16...175.............2/20...175...................0.....................0
.................................................. 2/26...350

Water/Gas.......1/6...150.............2/10...175...........3/3...150..........4/10...175

Thanks a lot...
A crosstab query can only have one field in the middle, not multiple fields. What you can do is first write a select query that will combine your date and amounts into one field, say, CombindedPayment.

Then create your crosstab against this query, using CombindedPayment as the middle field
May 31 '07 #2
ringer
32
A crosstab query can only have one field in the middle, not multiple fields. What you can do is first write a select query that will combine your date and amounts into one field, say, CombindedPayment.

Then create your crosstab against this query, using CombindedPayment as the middle field
Gotcha. Would you mind showing me how to write the crosstab query with only the dates in the middle? (With months -like Jan, Feb, Mar-- as column headers and the dates falling under the appropriate months)
Jun 1 '07 #3
Lysander
344 Expert 100+
Gotcha. Would you mind showing me how to write the crosstab query with only the dates in the middle? (With months -like Jan, Feb, Mar-- as column headers and the dates falling under the appropriate months)
I just realised that in a crosstab query, the value in the middle has to be grouped, i.e. sum of payment, count of records, min of date etc. It can't be just the value.

This query gives min of date, using the crosstab wizard
Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Min(tblInvoice.DateCleared) AS MinOfDateCleared
  2. SELECT tblInvoice.CompanyName
  3. FROM tblInvoice
  4. GROUP BY tblInvoice.CompanyName
  5. PIVOT Format([DateRaised],"mmm") In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
  6.  
Jun 1 '07 #4
ringer
32
Thanks. After more attempts with the wizard I got the results you posted above.
Do you think there's some way to use the crosstab query to pull in the results of another query for the middle data? My thought is that maybe the other query could be used to show the actual data without being summed, min'd, max'd, avg'd, or whatever.
Jun 1 '07 #5

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

Similar topics

8
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I...
3
by: Darleen | last post by:
I am seeking conceptual here on how to get started with a "3D Matrix" in Access. We run a training center which holds multiple classes in multiple cities at multiple times. So I need to create a...
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...
2
by: Sherman H. | last post by:
I have a few questions for crosstab and popup form questions: 1. I created a crosstab as follows: IT Financial Operation John 21 22 ...
3
by: Bryan | last post by:
I've been looking over this newsgroup, but I can't find an answer to my problem. I see that a few others have posted this issue over the years, but none of them got a response. I'll give it...
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....
6
by: tizmagik | last post by:
I am having a lot of difficulty generating a CrossTab Query based report. I have looked online for several tutorials and whatnot but I have not been able to really find what I'm looking for, nor...
27
by: Bob | last post by:
running access 2k; mdb w/ linked tables to another mdb (front/back-end); trying to run a query that updates a table FROM information from a crosstab query. I AM NOTT trying to update the...
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.