473,288 Members | 1,794 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,288 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 5921
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
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: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
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: 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)...

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.