A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Crosstab Report



 
 
Thread Tools Display Modes
  #1  
Old May 20th, 2004, 09:20 AM
news.microsoft.com
external usenet poster
 
Posts: n/a
Default Crosstab Report

Hi,

I have a table on which I would like to produce the following report (All
fields are in the table
WeekNo
Stockcode, Date sum(Qty)

I can do this but the problem I have is that dependent on the date range
that is chosen the weekNo changes and therefore the report will not run
because the control for the week no is the actual weekno.

How can I have a std report that displays the correct weekno when it is an
every changing field?

Thanks


  #2  
Old May 20th, 2004, 01:23 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default Crosstab Report

This is where I would use "relative weeks" rather than "absolute weeks".
Relative weeks would compare your date field to a date entered on a form to
create the columns. For instance, you could use an expression like:
ColHead:"Wk" & Datediff("ww",[DivDate],[Forms]![frmA]![txtEndDate])
This would create column headings like
"Wk0", "Wk1", "Wk2", "Wk3",...
Wk0 would contain the values for DivDate in the same week as txtEndDate. Wk6
would be 6 weeks earlier. You would need to set the Query|Parameters
[Forms]![frmA]![txtEndDate] Date/Time
and set the Column Headings property to
"Wk0", "Wk1", "Wk2", "Wk3",... (depends on how many weeks)
This method allows you to create a report that will ALWAYS have the same
column/fields. It requires no code and no future maintenance of the query or
report.


--
Duane Hookom
MS Access MVP


"news.microsoft.com" wrote in message
...
Hi,

I have a table on which I would like to produce the following report (All
fields are in the table
WeekNo
Stockcode, Date sum(Qty)

I can do this but the problem I have is that dependent on the date range
that is chosen the weekNo changes and therefore the report will not run
because the control for the week no is the actual weekno.

How can I have a std report that displays the correct weekno when it is an
every changing field?

Thanks




  #3  
Old May 20th, 2004, 02:23 PM
news.microsoft.com
external usenet poster
 
Posts: n/a
Default Crosstab Report

Thanks for this but people need to see the Week No.
Is there no way of doing this?
Could I code something in the on format of the report?
eg taking the entered date and then working backwards to get the week number
and putting it in a unbound textbox?
What do you?
Any help greatly appreciated

"Duane Hookom" wrote in message
...
This is where I would use "relative weeks" rather than "absolute weeks".
Relative weeks would compare your date field to a date entered on a form

to
create the columns. For instance, you could use an expression like:
ColHead:"Wk" & Datediff("ww",[DivDate],[Forms]![frmA]![txtEndDate])
This would create column headings like
"Wk0", "Wk1", "Wk2", "Wk3",...
Wk0 would contain the values for DivDate in the same week as txtEndDate.

Wk6
would be 6 weeks earlier. You would need to set the Query|Parameters
[Forms]![frmA]![txtEndDate] Date/Time
and set the Column Headings property to
"Wk0", "Wk1", "Wk2", "Wk3",... (depends on how many weeks)
This method allows you to create a report that will ALWAYS have the same
column/fields. It requires no code and no future maintenance of the query

or
report.


--
Duane Hookom
MS Access MVP


"news.microsoft.com" wrote in message
...
Hi,

I have a table on which I would like to produce the following report

(All
fields are in the table
WeekNo
Stockcode, Date sum(Qty)

I can do this but the problem I have is that dependent on the date range
that is chosen the weekNo changes and therefore the report will not run
because the control for the week no is the actual weekno.

How can I have a std report that displays the correct weekno when it is

an
every changing field?

Thanks






  #4  
Old May 20th, 2004, 05:26 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default Crosstab Report

Use the same type of expressions for you column headings in the report. Use
text boxes with control sources like:
=DateAdd("ww",0,[Forms]![frmA]![txtEndDate])
=DateAdd("ww",-1,[Forms]![frmA]![txtEndDate])
=DateAdd("ww",-2,[Forms]![frmA]![txtEndDate])
This should create column "labels" that vary depending on the date entered
on the form.

--
Duane Hookom
MS Access MVP
--

"news.microsoft.com" wrote in message
...
Thanks for this but people need to see the Week No.
Is there no way of doing this?
Could I code something in the on format of the report?
eg taking the entered date and then working backwards to get the week

number
and putting it in a unbound textbox?
What do you?
Any help greatly appreciated

"Duane Hookom" wrote in message
...
This is where I would use "relative weeks" rather than "absolute weeks".
Relative weeks would compare your date field to a date entered on a form

to
create the columns. For instance, you could use an expression like:
ColHead:"Wk" & Datediff("ww",[DivDate],[Forms]![frmA]![txtEndDate])
This would create column headings like
"Wk0", "Wk1", "Wk2", "Wk3",...
Wk0 would contain the values for DivDate in the same week as txtEndDate.

Wk6
would be 6 weeks earlier. You would need to set the Query|Parameters
[Forms]![frmA]![txtEndDate] Date/Time
and set the Column Headings property to
"Wk0", "Wk1", "Wk2", "Wk3",... (depends on how many weeks)
This method allows you to create a report that will ALWAYS have the same
column/fields. It requires no code and no future maintenance of the

query
or
report.


--
Duane Hookom
MS Access MVP


"news.microsoft.com" wrote in message
...
Hi,

I have a table on which I would like to produce the following report

(All
fields are in the table
WeekNo
Stockcode, Date sum(Qty)

I can do this but the problem I have is that dependent on the date

range
that is chosen the weekNo changes and therefore the report will not

run
because the control for the week no is the actual weekno.

How can I have a std report that displays the correct weekno when it

is
an
every changing field?

Thanks








 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.