473,698 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there a trick to not have a cross-tab query sort the column headings?

pw
Hi,

I have month names (coming from a field in a table) as the column
heading in an Access 97 crosstab query. It is being sorted
alphabetically. This will not do. The only way that I know to get
around it is to use month numbers instead, but I'd rather have the
names appear.

Any ideas?

Thanks,

-pw
please use "pw at williamsonenter prises dot com" for e-mail
thanks
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #1
4 5323
DFS
pw,

Since you generally use the query as the datasource for a form or report,
reorder the columns in the bound fields of the form or report object.

If you use the form wizard and create a datasheet default form, it will look
just like the query results anyway, but you can move the columns around and
save the ordering.


"pw" <pw@removewilli amsonenterprise s.com> wrote in message
news:tr******** *************** *********@4ax.c om...
Hi,

I have month names (coming from a field in a table) as the column
heading in an Access 97 crosstab query. It is being sorted
alphabetically. This will not do. The only way that I know to get
around it is to use month numbers instead, but I'd rather have the
names appear.

Any ideas?

Thanks,

-pw
please use "pw at williamsonenter prises dot com" for e-mail
thanks
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---
Nov 12 '05 #2
pw
>
1) Open your crosstab query in design mode.
2) Switch to SQL View
3) Find the PIVOT statement in the SQL statement.
4) After the field the PIVOT statement is working on, add in:

IN
("January","Fe bruary","March" ,"April","May", "June","July"," August","Septem ber","October", "November","Dec ember")

(watch the word wrap!)

Change the order of the month names to get whatever order you
want/need. By manipulating the IN Clause of the PIVOT statement, you
also control the left-to-right order of the columns. This is a fairly
common "trick" to do (in code) to create reports that appear to always
have the last month as the first column, the month before that as the
2nd column... (aka "rolling columns")

Note: after making this change, and then switching back to "Design
mode", you won't see the in clause. Access doesn't show it, but it's
there, and it persists. (If memory serves, they do appear under the
"ColumnHeading s" property of the field you have selected for a column
heading.)

Hi Chuck!

It worked! Except putting in the month name blanks out the zeroes
that were in columns(months) that didn't have any records for that
month. I need the zeroes in any cell that doesn't have any data for
it. The user is going to copy and paste this pivot table into Excel
(I offered to try and do it automatically through Office Automation
but he doesn't mind just copy and pasting it).

Any ideas?

Thanks!

-paul



On Tue, 16 Dec 2003 15:32:38 -0700, pw
<pw@removewill iamsonenterpris es.com> wrote:
I have month names (coming from a field in a table) as the column
heading in an Access 97 crosstab query. It is being sorted
alphabeticall y. This will not do. The only way that I know to get
around it is to use month numbers instead, but I'd rather have the
names appear.


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #3
pw
>pw,

Since you generally use the query as the datasource for a form or report,
reorder the columns in the bound fields of the form or report object.

If you use the form wizard and create a datasheet default form, it will look
just like the query results anyway, but you can move the columns around and
save the ordering.


I haven't thought what I am going to do with this query yet :-) Well,
I guess I have. It needs to be somewhere where the user can copy and
paste it into Excel.

I'll mess around with a form and try reordering the columns. Chuck's
suggestion worked though, except adding the month names in code
blanked out any cells that had zeroes in them (unless the column had a
value > 1 somewhere). I think I need zeroes, not blanks.

Thanks!!

-pw


"pw" <pw@removewilli amsonenterprise s.com> wrote in message
news:tr******* *************** **********@4ax. com...
Hi,

I have month names (coming from a field in a table) as the column
heading in an Access 97 crosstab query. It is being sorted
alphabetically. This will not do. The only way that I know to get
around it is to use month numbers instead, but I'd rather have the
names appear.

Any ideas?

Thanks,

-pw
please use "pw at williamsonenter prises dot com" for e-mail
thanks
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #4
pw
>On Wed, 17 Dec 2003 11:01:17 -0700, pw
<pw@removewill iamsonenterpris es.com> wrote:
1) Open your crosstab query in design mode.
2) Switch to SQL View
3) Find the PIVOT statement in the SQL statement.
4) After the field the PIVOT statement is working on, add in:
IN
("January"," February","Marc h","April","May ","June","July" ,"August","Sept ember","October ","November","D ecember")
(watch the word wrap!)
Change the order of the month names to get whatever order you
want/need. By manipulating the IN Clause of the PIVOT statement, you
also control the left-to-right order of the columns. This is a fairly
common "trick" to do (in code) to create reports that appear to always
have the last month as the first column, the month before that as the
2nd column... (aka "rolling columns")
Note: after making this change, and then switching back to "Design
mode", you won't see the in clause. Access doesn't show it, but it's
there, and it persists. (If memory serves, they do appear under the
"ColumnHeadi ngs" property of the field you have selected for a column
heading.)

Hi Chuck!
It worked! Except putting in the month name blanks out the zeroes
that were in columns(months) that didn't have any records for that
month. I need the zeroes in any cell that doesn't have any data for
it. The user is going to copy and paste this pivot table into Excel
(I offered to try and do it automatically through Office Automation
but he doesn't mind just copy and pasting it).


Unfortunatel y, there's really no way around that. Well, there are a
couple of ways, neither of which do I use unless I have to, and that's
pretty darn rare. Personally, I just do my own export to excel when I
have to do this, and use the NZ function as a part of that code to
translate the Nulls. (If you haven't seen my "ExportToEx cel"
function, which I've posted here a couple of times, I suggest getting
it. You can put it behind any form and just let the user click on a
button to run the query and create a Excel spreadsheet. I can post it
again, if needed, but....)

The other (non-recommended methods) involve using a query (or a set of
queries) or a table that will ensure that you won't have any "missing"
information for the cross-tab.


Learning lots from you Chuck. I searched this group in Google and I
see a bunch of posts of "ExportToEx cel" but I didn't see you name on
them. I want to make sure I get the original :-)

Thanks again,

-paul
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #5

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

Similar topics

17
21934
by: Eternally | last post by:
Hey folks, I'm writing a simple C++ application which runs continuously. I'm running the program from the command line in Cygwin from XP, and it's cross-compatible with Linux. While running the program, I notice that the CPU usage is 100%, with my application stealing 97% of it. I'd like to bring that down to at most 10% of the CPU usage. What's the
34
2664
by: Marian Aldenhövel | last post by:
Hi, I am in the process of embarking on building a large web application. I wanted to seize that opportunity to learn how to use CSS and get rid of my ad-hoc approach to HTML-coding (i.e.: add tables until either the result is OK or I decide to start over). However I do not seem to be able to get it right. Experimentation is beginning to wear me out...
7
9318
by: Daniel Jung | last post by:
Hi ======== Problem: ======== I want images in table rows connect vertically. All images are 32 px in height. =====
1
4109
by: MatthewRoberts | last post by:
Howdy All, I am having difficulty with two-way communication across AppDomains in an attempt to dynamically script applications. Everything works as expected, except when using ByRef parameters. The below explanation is lengthy, but well worth the read. If you can help me, I'd gladly share this code which has greatly helped my development of extensible applications.
1
1293
by: Gene Ariani | last post by:
Hi; Does any one know of asp.net web menu with cross frames capability, so the menus can cross frames and not be contained in them? Any direction is appreciated it.
35
5497
by: Alex Martelli | last post by:
Having fixed a memory leak (not the leak of a Python reference, some other stuff I wasn't properly freeing in certain cases) in a C-coded extension I maintain, I need a way to test that the leak is indeed fixed. Being in a hurry, I originally used a q&d hack...: if sys.platform in ('linux2', 'darwin'): def _memsize(): """ this function tries to return a measurement of how much memory this process is consuming, in some arbitrary unit...
16
2347
by: petermichaux | last post by:
Hi, Does anyone have a a cross-browser setOpacity function that does not use browser sniffing? I looked at the Yahoo! UI function and it detects IE by looking for window.ActiveXObject. I also looked at Scriptaculous and it uses navigator.userAgent. Thanks, Peter
2
11762
by: mattgarvin | last post by:
Hello, I need a piece of javascript that will allow a form to be submitted when Enter is pressed for IE6 and 7, Firefox 2, and recent versions of Safari. It is for a login page that has two textboxes: a "Login" and a "Password". The "Login Button" is actually a standard image with an onClick event handler to submit the form, because we use a mouseover effect. (That is, it is not INPUT TYPE="IMAGE" but rather an IMAGE tag with...
3
2058
by: Randy Yates | last post by:
Hi Folks, I have a cross-development problem in which I'm using the x86_64 version of Fedora Core 6 as a development system but want to build executables that are 32-bit. I've got a mix of C (mainly C) and about 2 or 3 assembly routines. I'm using yasm as my assembler and gcc 4.1.2 for my C compiler, and GNU ld version 2.17.50.0.6-2.fc6 20061020 as my linker. I thought that if I just specified a 32-bit target for the C compiler via...
7
8834
by: atlaste | last post by:
Hi, I have two different things I'd like to discuss here. Both are about cross-process synchronization of shared resources. The resources that are shared are: (1) an object writing to a file and (2) a file. I threat them as two different problems for various reasons. The first problem involves the object writing to a file. The problem might be best explained by thinking of a single log file that's appended by different programs that...
0
8680
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
9169
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
9030
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...
0
8871
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...
0
7738
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
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...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2007
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.