dbTalk Databases Forums  

Help with Report Design

comp.databases.ms-access comp.databases.ms-access


Discuss Help with Report Design in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Steven Taylor
 
Posts: n/a

Default Help with Report Design - 09-16-2005 , 02:27 AM






Hope someone can help.

Table structure: Name : tbl_Runs

Fields are:

Run_ID
Run_Date
Run_Distance (km)
Run_Duration (secs)

I want to create/design a report whereby columns are the days of the
week and the rows are the week numbers of the year.

Within each cell I want to merely print "Run_Distance".

I'm going around in circles with this one so any advice would be
appreciated.

Steven Taylor
Melbourne, Australia.

Reply With Quote
  #2  
Old   
Allen Browne
 
Posts: n/a

Default Re: Help with Report Design - 09-16-2005 , 02:47 AM






Create a query into this table.

Change it to a Crosstab query (Crosstab on Query menu.)
Access adds Total and Crosstab rows to the design grid.

In a fresh column in the Field row of the grid, enter:
TheYear: Year([RunDate])
In the Crosstab row under this field, choose Row Heading.

In the next column, Field row, enter:
TheWeek: DatePart([RunDate]), "ww")
Again set the Crosstab to Row Heading.

In the Field row, enter:
DOW: Weekday([RunDate])
In the Crosstab row under this field, choose Column Heading.

Drag the Run_Distance into the grid.
In the Total row, choose Sum.
In the Crosstab row, choose Value.

The query will generate:
- a column for the year;
- a column for the week of the year;
- a column for each day of the week, containing the sum of the distance.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Steven Taylor" <newslist (AT) superjacent (DOT) net> wrote

Quote:
Hope someone can help.

Table structure: Name : tbl_Runs

Fields are:

Run_ID
Run_Date
Run_Distance (km)
Run_Duration (secs)

I want to create/design a report whereby columns are the days of the week
and the rows are the week numbers of the year.

Within each cell I want to merely print "Run_Distance".

I'm going around in circles with this one so any advice would be
appreciated.

Steven Taylor
Melbourne, Australia.



Reply With Quote
  #3  
Old   
Steven Taylor
 
Posts: n/a

Default Re: Help with Report Design - 09-16-2005 , 03:46 AM



Thanks Allen, it works a treat.

Steve.

Allen Browne wrote:
Quote:
Create a query into this table.

Change it to a Crosstab query (Crosstab on Query menu.)
Access adds Total and Crosstab rows to the design grid.

In a fresh column in the Field row of the grid, enter:
TheYear: Year([RunDate])
In the Crosstab row under this field, choose Row Heading.

In the next column, Field row, enter:
TheWeek: DatePart([RunDate]), "ww")
Again set the Crosstab to Row Heading.

In the Field row, enter:
DOW: Weekday([RunDate])
In the Crosstab row under this field, choose Column Heading.

Drag the Run_Distance into the grid.
In the Total row, choose Sum.
In the Crosstab row, choose Value.

The query will generate:
- a column for the year;
- a column for the week of the year;
- a column for each day of the week, containing the sum of the distance.


Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.