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 3 4166
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!txtE ndDate Date/Time
Use this expression for your Column Headings:
ColHead:"Mth" & DateDiff("m",[SaleDate],Forms!frmA!txt EndDate)
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!txtE ndDate)
=DateAdd("m",-1,Forms!frmA!tx tEndDate)
=DateAdd("m",-2,Forms!frmA!tx tEndDate)
=DateAdd("m",-3,Forms!frmA!tx tEndDate)
...
This solution requires no code and will run fairly quickly.
--
Duane Hookom
MS Access MVP
"Paula" <pm*****@notmym ail.com> wrote in message
news:B3******** *********@newsr ead2.news.atl.e arthlink.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
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.co m> wrote in message
news:uU******** ******@TK2MSFTN GP10.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!txtE ndDate Date/Time
Use this expression for your Column Headings: ColHead:"Mth" & DateDiff("m",[SaleDate],Forms!frmA!txt EndDate)
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!txtE ndDate) =DateAdd("m",-1,Forms!frmA!tx tEndDate) =DateAdd("m",-2,Forms!frmA!tx tEndDate) =DateAdd("m",-3,Forms!frmA!tx tEndDate) ... This solution requires no code and will run fairly quickly.
-- Duane Hookom MS Access MVP
"Paula" <pm*****@notmym ail.com> wrote in message news:B3******** *********@newsr ead2.news.atl.e arthlink.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
Try a column heading expression like
"Yr" & DateDiff("m",[DateField],Date())\12
--
Duane Hookom
MS Access MVP
"Paula" <pm*****@notmym ail.com> wrote in message
news:wR******** *********@newsr ead2.news.atl.e arthlink.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.co m> wrote in message news:uU******** ******@TK2MSFTN GP10.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!txtE ndDate Date/Time
Use this expression for your Column Headings: ColHead:"Mth" & DateDiff("m",[SaleDate],Forms!frmA!txt EndDate)
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!txtE ndDate) =DateAdd("m",-1,Forms!frmA!tx tEndDate) =DateAdd("m",-2,Forms!frmA!tx tEndDate) =DateAdd("m",-3,Forms!frmA!tx tEndDate) ... This solution requires no code and will run fairly quickly.
-- Duane Hookom MS Access MVP
"Paula" <pm*****@notmym ail.com> wrote in message news:B3******** *********@newsr ead2.news.atl.e arthlink.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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 ...
|
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
|
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 another
report it is giving the following error:
You can't us a passthrough query or a non-fixed-column crosstab query
as a record source for a subform or subreport.
Before you bind the subform or subreport to a crosstab query, set the
|
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 sub-report will capture
what grades the student has achieved in a list of different subjects
and the reason I need it to be dynamic is that students take different
subjects.
Basically I've been trying to doctor the KB article on dynamic
|
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 I make a Crosstab Query that shows all rows, regardless they have values in column headings.
For instance, the result that I get now is like this
| |
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 list is pretty long,
but far from having 255 entries.
I specify which columns I want so that it doesn't give me an error
message because a field has no valid data attached to it.
|
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 there any way to make the
column headings fixed in the crosstab query so the field names can be bound
to report fields without problem?
Thanks
|
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..
So if the user selects 3 months in the criteria form, there will be 3
(month) column headings, if he selects 6 months, the will be 6
headings.
|
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 has the following fields:
SPID (supervisor ID), total:group by, as row heading
Date, total:group by, as column heading
Calls handled, total:sum, as value
Date, total:where, criteria between and - this is taken from a form,
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |