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

format of column heading in crosstab query

Hi,
I want to create a crosstab query that looks like this

Date | Elevation 1 | Elevation 2 | ...
__________________________________________________ ____________________
Date 1 | xx.y | xx.y
Date 2 | xx.y | xx.y

xx.y are measurements taken at different dates at different elevations.
xx.y and elevation happen to be in the same format (meters).

The problem is, that the elevations in the column heading are numbers.
In the heading of the crosstab query in datasheet view they are all not
defined as numbers. They look like "286_983". That is the decimal point
is replaced by an underscore.

I needed them to be in number format, so I can plot the crosstab
Is there a way to change the number format? I tried cdec, but it
wouldn't work.

I don't want to change Elevation with Date (rowheading with
columnheading), because I want to make a chart from it later (and I
didn't find a way to make a chart with the rowheading as datasource for
the y-axis)

The SQL looks like this (WTelev are the xx.y in the sample above)

TRANSFORM Avg(WTelev) AS AvgOfWTelev
SELECT [date of sampling]
FROM qry_WTprof INNER JOIN {...}
GROUP BY [date of sampling]
ORDER BY [date of sampling]
PIVOT ElevationMP;

I'd appreciate any help!
Thanks,
Claus
Nov 13 '05 #1
2 5932
Claus Haslauer wrote:
Hi,
I want to create a crosstab query that looks like this

Date | Elevation 1 | Elevation 2 | ...
__________________________________________________ ____________________
Date 1 | xx.y | xx.y
Date 2 | xx.y | xx.y

xx.y are measurements taken at different dates at different elevations.
xx.y and elevation happen to be in the same format (meters).

The problem is, that the elevations in the column heading are numbers.
In the heading of the crosstab query in datasheet view they are all not
defined as numbers. They look like "286_983". That is the decimal point
is replaced by an underscore.

I needed them to be in number format, so I can plot the crosstab
Is there a way to change the number format? I tried cdec, but it
wouldn't work.

I don't want to change Elevation with Date (rowheading with
columnheading), because I want to make a chart from it later (and I
didn't find a way to make a chart with the rowheading as datasource for
the y-axis)

The SQL looks like this (WTelev are the xx.y in the sample above)

TRANSFORM Avg(WTelev) AS AvgOfWTelev
SELECT [date of sampling]
FROM qry_WTprof INNER JOIN {...}
GROUP BY [date of sampling]
ORDER BY [date of sampling]
PIVOT ElevationMP;


Change

PIVOT ElevationMP

to

PIVOT "Elevation " & Format(ElevationMP, "000.000")

This assumes the data type of the column "ElevationMP" is a numeric data
type.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #2
MGFoster wrote:
Claus Haslauer wrote:
Hi,
I want to create a crosstab query that looks like this

Date | Elevation 1 | Elevation 2 | ...
__________________________________________________ ____________________
Date 1 | xx.y | xx.y
Date 2 | xx.y | xx.y

xx.y are measurements taken at different dates at different elevations.
xx.y and elevation happen to be in the same format (meters).

The problem is, that the elevations in the column heading are
numbers. In the heading of the crosstab query in datasheet view they
are all not defined as numbers. They look like "286_983". That is the
decimal point is replaced by an underscore.

I needed them to be in number format, so I can plot the crosstab
Is there a way to change the number format? I tried cdec, but it
wouldn't work.

I don't want to change Elevation with Date (rowheading with
columnheading), because I want to make a chart from it later (and I
didn't find a way to make a chart with the rowheading as datasource
for the y-axis)

The SQL looks like this (WTelev are the xx.y in the sample above)

TRANSFORM Avg(WTelev) AS AvgOfWTelev
SELECT [date of sampling]
FROM qry_WTprof INNER JOIN {...}
GROUP BY [date of sampling]
ORDER BY [date of sampling]
PIVOT ElevationMP;

Change

PIVOT ElevationMP

to

PIVOT "Elevation " & Format(ElevationMP, "000.000")

This assumes the data type of the column "ElevationMP" is a numeric data
type.

Hm, the number of zeros after the decimal point determines how many
decimal points show up in the crosstab query. Unfortunately, it doesn't
change the decimal separator in the crosstab query from an underscore to
a decimal point.

Hm, if I change rowheading and columnheading, I get a chart by
inseerting a ms graph chart into an access form that is what I want,
except that it is 90 degrees rotated (i.e. I'd like the x-axis to be the
y-axis and vice versa).
I searched on goole about this, but all results said, the y-axis is the
one that shows the range of the values. Is that true?

Thanks,
Claus
Nov 13 '05 #3

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

Similar topics

4
by: Thomas Jerkins | last post by:
When I write a create table SQL statement I want to add some information about the column heading of each column. How does the exact syntax for the create table look like (which includes this column...
4
by: pw | last post by:
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...
1
by: Steve | last post by:
I have looked through the newsgroup for an answer to this but haven't been able to find anything resembling my situation. What I want to do is relatively simple, I think. I have a crosstab...
3
by: Edward | last post by:
ACCESS 2k I need to design a report based on a rota system for staff at various shops. The data is effectively stored in a single table, along the lines of: Initials (e.g. BH, FG, RM etc.)...
3
by: Paula | last post by:
I need to do a summary using a crosstab query. The data has a Date field (Not named "Date"). I can do the Row Heading and Value but am having trouble with the Column Heading. The summary Columns...
2
by: carl.barrett | last post by:
Hi, I'm back with the same question as I still can't get it to display my data the way I want it to. The table lists information about a perpetrator involved with an anti social behaviour...
0
by: Kaur | last post by:
Hi, I have created a report based on a cross tab query and would like to Sort the column heading of the report based on the sort order of another field. I have three tables called survey...
0
by: Kaur | last post by:
Hi, I have created a report based on a cross tab query and would like to Sort the column heading of the report based on the sort order of another field. I have three tables called survey...
1
by: c8tz | last post by:
This is a query I have created that picks up the top 3 dates for this data (for example) : Tree Pos2 Date 1 15 23/08/2005 1 20 12/02/2006 1 32 15/10/2006 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
0
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...

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.