Crosstab query

  • Thread starter Thread starter Gus Chuch
  • Start date Start date
G

Gus Chuch

The standard access crosstab query uses the PIVOT Format([Date],â€mmmâ€)
In(“Janâ€,â€Febâ€,â€Marâ€,…) to make columns for the (12)months of the year, how
would you Format the Date for (52) weeks of the year?
The week should start on Sunday - right?
 
Gus said:
The standard access crosstab query uses the PIVOT Format([Date],â€mmmâ€)
In(“Janâ€,â€Febâ€,â€Marâ€,…) to make columns for the (12)months of the year, how
would you Format the Date for (52) weeks of the year?
The week should start on Sunday - right?
Use the DatePart function to get the week, e.g.

PIVOT DatePart("ww", [Date]) IN (1, 2, ..., 53)

The 53 is not a typo, some years have 53 calendar weeks.


mfG
--> stefan <--
 
Works great, but how can you get the columns to have meaningful names?
--
thank You


Stefan Hoffmann said:
Gus said:
The standard access crosstab query uses the PIVOT Format([Date],â€mmmâ€)
In(“Janâ€,â€Febâ€,â€Marâ€,…) to make columns for the (12)months of the year, how
would you Format the Date for (52) weeks of the year?
The week should start on Sunday - right?
Use the DatePart function to get the week, e.g.

PIVOT DatePart("ww", [Date]) IN (1, 2, ..., 53)

The 53 is not a typo, some years have 53 calendar weeks.


mfG
--> stefan <--
 
hi Gus,

Gus said:
Works great, but how can you get the columns to have meaningful names?
You can use the Caption property of the crosstab query. Open the query
in the design view and open the property editor.


mfG
--> stefan <--
 
I would think the week number would be meaningful. If you are displaying the
results in a form or report, you can create column headings with text boxes
bound to "meaningful" values.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Error 3205 - Too Many Crosstab Column Headers (300) 2
Help on crosstab query 2
How to Union Crosstabs... 1
Crosstab Queries by week 2
crosstab query? 12
Crosstab column data count 6
Crosstab Query 1
crosstab query? 3

Back
Top