473,748 Members | 2,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Crosstab query help

32 New Member
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:

_____________Ja n_____________F eb___________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 1963
Lysander
344 Recognized Expert Contributor
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:

_____________Ja n_____________F eb___________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, CombindedPaymen t.

Then create your crosstab against this query, using CombindedPaymen t as the middle field
May 31 '07 #2
ringer
32 New Member
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, CombindedPaymen t.

Then create your crosstab against this query, using CombindedPaymen t 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 Recognized Expert Contributor
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 New Member
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
7587
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 want them to do as little as possible when they run their reports. I have a crosstab query that displays usage of items for each month. It looks pretty much like this: ITEM DESC UM 12/02 1/03 2/03 3/03 ...ETC. 1 Solution ...
3
3211
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 matrix with 3 "axis". The 3 axes are: City Location Week of Class (in 14 week increments that repeat) Name of Class The end goal is to be able to have a form that shows these classes in
1
17670
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 Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
2
3048
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 22 Mary 15 17 16 Joe 28 29 31 For some other instances, the Operation column was not created because the
3
3419
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 another shot. I have a report that is based on a crosstab query. The crosstab query is based off of another query, and that has a parameter in the where clause. Like this: WHERE e.elevationid = !!
14
3496
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. However, the expectation changes - it may be 60% for a while, then change to 50%. Initially, I was averaging the expectation, along with the productivity, but what I'm being asked is to look at the average productivity/performance compared to...
6
4479
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 have I been able to adapt other people's solutions/tips to fit what I need. If anyone could please help me with the following it would be really appreciated, thank you! I need to generate a Report (say: repCrossTab) that grabs it's data from the...
27
18400
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 crosstab query itself - only use information FROM it to update a perfectly updatable table! Why the ---- would I get this error, when there are clearly NO permission issues, or issues in updating the table I'm trying to
4
6479
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 flat file. Ideally I would like to be able to just select the Last 2 Columns of the Crosstab query as inputs to the Select query WITHOUT having to go in month after month and manually change it... I may be asking a bit much here but is there a...
4
2472
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 account, garment type (Jacket, skirt, etc), client sizing spec and descriptives (measurement names i.e: Shoulder to cuff, inside leg, etc), available sizes (ie. 4,6,8,10,12,14,16,18,20,S,M,L,SM,ML,One) and pattern adjustments (if size 10 is the base, the...
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9544
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9372
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6796
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3313
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 we have to send another system
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.