Crosstab query

  • Thread starter Frederik Vanderhaeghe
  • Start date
F

Frederik Vanderhaeghe

Hi,

I would like to make a crosstab query in which the colum headers are the
months out of the datefield. How can I get the monthsname (Jan., Feb.,...)
out of the datefield and into the colum header??

Fré
 
J

John Spencer

Instead of DateField use
Format(DateField, "MMM")

If you want the column to appear in order Jan to Dec instead of
alphabetically, then you also need to enter the month abbreviations in the
column heading property.

In SQL you would change the last line of your Crosstab query to read
something like

Pivot Format(DateField, "MMM") IN ("Jan","Feb",...,"Dec")
 
D

Duane Hookom

Set your column heading expression to something like:
Colhead: Format([DateField],"mmm")
Then set the Column Headings property of the crosstab to:
Column Headings: "Jan", "Feb","Mar",...."Dec"
 
Top