473,394 Members | 1,709 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.

Crosstab Column Headings

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 needs to read like:
Sept01 to Aug02 Sept02 to Aug03 Sept03 to Aug04
Can anyone give me a recommendation on how to get from the Date field to
these Column Headings? I then would like to set criteria where I can select
something that will give me either 1, 2, 3 , 4 or 5 columns in a selected
date range. I need help on that too.

Thanks!

Paula
Nov 13 '05 #1
3 4135
If possible, don't use "absolute" column headings for dates. You could
possibly use "relative" dates. For instance:
Form: frmA
Text Box: txtEndDate
Table: tblSales
Field: SaleDate
You want to show 12 months of sales in columns of a crosstab report.
Set the with menuing: Query|Parameter
Forms!frmA!txtEndDate Date/Time

Use this expression for your Column Headings:
ColHead:"Mth" & DateDiff("m",[SaleDate],Forms!frmA!txtEndDate)

This will produce Mth0, Mth1, Mth2, Mth3,... where Mth0 is sales from the
same month as the ending date on your form. Mth1 is the previous month etc.

Set your queries Column Headings property to:
"Mth0", "Mth1", "Mth2", "Mth3",.., "Mth11"
Build your report based on these "relative" months. If you need column
labels in your report, use text boxes with control sources of:
=DateAdd("m",0,Forms!frmA!txtEndDate)
=DateAdd("m",-1,Forms!frmA!txtEndDate)
=DateAdd("m",-2,Forms!frmA!txtEndDate)
=DateAdd("m",-3,Forms!frmA!txtEndDate)
...
This solution requires no code and will run fairly quickly.

--
Duane Hookom
MS Access MVP
"Paula" <pm*****@notmymail.com> wrote in message
news:B3*****************@newsread2.news.atl.earthl ink.net...
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 needs to read like:
Sept01 to Aug02 Sept02 to Aug03 Sept03 to Aug04
Can anyone give me a recommendation on how to get from the Date field to
these Column Headings? I then would like to set criteria where I can select something that will give me either 1, 2, 3 , 4 or 5 columns in a selected
date range. I need help on that too.

Thanks!

Paula

Nov 13 '05 #2
Duane,

Thanks for responding to this post also! And thanks once again for showing
me how to get the zeroes!

I'm sorry my post here was not absolutely clear. I do not want a monthly
summary. I want a yearly summary where the colum headings I showed are
twelve month periods. So in my example, I want three columns with the total
for the twelve month period being the value. I can do the Row Heading and
the Value, I need help on how to go from the Date field to the Column
Heading where the twelve month period starts at some month in a year and
goes to the previous month in the next year.

Please give it a relook!

Paula
"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> wrote in message
news:uU**************@TK2MSFTNGP10.phx.gbl...
If possible, don't use "absolute" column headings for dates. You could
possibly use "relative" dates. For instance:
Form: frmA
Text Box: txtEndDate
Table: tblSales
Field: SaleDate
You want to show 12 months of sales in columns of a crosstab report.
Set the with menuing: Query|Parameter
Forms!frmA!txtEndDate Date/Time

Use this expression for your Column Headings:
ColHead:"Mth" & DateDiff("m",[SaleDate],Forms!frmA!txtEndDate)

This will produce Mth0, Mth1, Mth2, Mth3,... where Mth0 is sales from the
same month as the ending date on your form. Mth1 is the previous month etc.
Set your queries Column Headings property to:
"Mth0", "Mth1", "Mth2", "Mth3",.., "Mth11"
Build your report based on these "relative" months. If you need column
labels in your report, use text boxes with control sources of:
=DateAdd("m",0,Forms!frmA!txtEndDate)
=DateAdd("m",-1,Forms!frmA!txtEndDate)
=DateAdd("m",-2,Forms!frmA!txtEndDate)
=DateAdd("m",-3,Forms!frmA!txtEndDate)
...
This solution requires no code and will run fairly quickly.

--
Duane Hookom
MS Access MVP
"Paula" <pm*****@notmymail.com> wrote in message
news:B3*****************@newsread2.news.atl.earthl ink.net...
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 needs to read like:
Sept01 to Aug02 Sept02 to Aug03 Sept03 to Aug04
Can anyone give me a recommendation on how to get from the Date field to
these Column Headings? I then would like to set criteria where I can

select
something that will give me either 1, 2, 3 , 4 or 5 columns in a selected date range. I need help on that too.

Thanks!

Paula


Nov 13 '05 #3
Try a column heading expression like
"Yr" & DateDiff("m",[DateField],Date())\12

--
Duane Hookom
MS Access MVP
"Paula" <pm*****@notmymail.com> wrote in message
news:wR*****************@newsread2.news.atl.earthl ink.net...
Duane,

Thanks for responding to this post also! And thanks once again for showing
me how to get the zeroes!

I'm sorry my post here was not absolutely clear. I do not want a monthly
summary. I want a yearly summary where the colum headings I showed are
twelve month periods. So in my example, I want three columns with the total for the twelve month period being the value. I can do the Row Heading and
the Value, I need help on how to go from the Date field to the Column
Heading where the twelve month period starts at some month in a year and
goes to the previous month in the next year.

Please give it a relook!

Paula
"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> wrote in message
news:uU**************@TK2MSFTNGP10.phx.gbl...
If possible, don't use "absolute" column headings for dates. You could
possibly use "relative" dates. For instance:
Form: frmA
Text Box: txtEndDate
Table: tblSales
Field: SaleDate
You want to show 12 months of sales in columns of a crosstab report.
Set the with menuing: Query|Parameter
Forms!frmA!txtEndDate Date/Time

Use this expression for your Column Headings:
ColHead:"Mth" & DateDiff("m",[SaleDate],Forms!frmA!txtEndDate)

This will produce Mth0, Mth1, Mth2, Mth3,... where Mth0 is sales from the
same month as the ending date on your form. Mth1 is the previous month

etc.

Set your queries Column Headings property to:
"Mth0", "Mth1", "Mth2", "Mth3",.., "Mth11"
Build your report based on these "relative" months. If you need column
labels in your report, use text boxes with control sources of:
=DateAdd("m",0,Forms!frmA!txtEndDate)
=DateAdd("m",-1,Forms!frmA!txtEndDate)
=DateAdd("m",-2,Forms!frmA!txtEndDate)
=DateAdd("m",-3,Forms!frmA!txtEndDate)
...
This solution requires no code and will run fairly quickly.

--
Duane Hookom
MS Access MVP
"Paula" <pm*****@notmymail.com> wrote in message
news:B3*****************@newsread2.news.atl.earthl ink.net...
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 needs to read like:
Sept01 to Aug02 Sept02 to Aug03 Sept03 to Aug04
Can anyone give me a recommendation on how to get from the Date field to these Column Headings? I then would like to set criteria where I can

select
something that will give me either 1, 2, 3 , 4 or 5 columns in a

selected date range. I need help on that too.

Thanks!

Paula



Nov 13 '05 #4

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

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...
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...
1
by: krish_4u_only | last post by:
Hi, I have designed a subreport - record source is on crosstab query. crosstab query is designed on union query. The sub report is working fine when it is opened individually. but if i place it on...
2
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
2
by: Nenad Markovic | last post by:
Hi everybody, When executing a Crosstab Query I see only rows (defined in a row heading) that have values (defined in value field) in at least one column (defined as column headings). How can...
3
by: Mike | last post by:
Hi, Im trying to create a crosstab query with fewer than 255 headings (about 50), but it crashes when I try to save after writing the heading names in the query property "column headings". My...
1
by: John | last post by:
Hi I have a report bound to a crosstab query. The problem is that under different conditions crosstab returns different column headings. This causes problems with binding of fields on report. Is...
8
by: Paul H | last post by:
I want to base a form on a crosstab query. The query shows statistics for a user defined period. The column headings will look something like this: ClientID Month01 Month02 Month03 etc.. ...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...

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.