Re: Crosstab query column headings



Assuming you want a three month period that ends on the date value in the
control Forms!frmDates!txtEndDate:
Use a column heading expression of:
ColHead: "Mth" & DateDiff("m", [DateField],Forms!frmDates!txtEndDate)
Set the Column Headings property to Mth0, Mth1,Mth2 for three months up to
and including the date on the form.

You may also need to set the data type of your query pararmeter. Select
Query->Parameters and enter
Forms!frmDates!txtEndDate Date/Time

--
Duane Hookom
MS Access MVP


"Matt Clepper" <MattClepper@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:730FDC1A-C224-49BB-AD68-3810A805DA27@xxxxxxxxxxxxxxxx
> Is there any way to specify the column heading names in a crosstab query.
> Here's my issue. I'm building a report that bases off a crosstab query.
> Of
> course the crosstab query headers are named the pivot values. However,
> the
> query is looking at trends and the column headers will change. For
> example,
> I have a query give me a trend over the past 3 months, pivoted on the
> month -
> so I get column headings Feb, Mar, April. If I run the same query next
> month, I'll get colum headings Mar, April, May. I'd like to just name
> them
> Month1, Month2, Month3. The access report that is based on the query has
> to
> have the control source specified, but it's a column header that is
> constantly changing. Any help? I believe my only two options are to
> figure
> out how to make the query heading static (Month1, etc) or make the control
> source in my report look for a specific column number (query.column(2) -
> ??this doesn't seem to work) and not a column name 'Jan'.
>
> Thanks!


.



Relevant Pages

  • Re: Corstabquery or normal query
    ... the Column Heading, and first of the name field as the value. ... H. Frank Situmorang ... instruction a while back to "Use the CountOfBidangPelayanan as the the Column ... This is my SQL for Query: ...
    (microsoft.public.access.reports)
  • Re: Crosstab Query Question
    ... Don't think I ever tried using multiple Column Heading source fields in one ... > crosstab query for each column heading or are you limited to just one? ... >> You do not want an IN list in the PIVOT clause. ...
    (microsoft.public.access.queries)
  • Re: Conditional formatting in a Crosstab Query
    ... Set it to the list of values you want the query to use. ... >prespecify the months by using the crosstab query's Column Heading ... >property".Sincerely I do not know what to write on the Column Heading ... >> decide on a maximum number of months to display on the form. ...
    (microsoft.public.access.queries)
  • Re: Percent calculation based on cross-tab query
    ... I created a new query which drew upon ... Allen Browne - Microsoft MVP. ... A crosstab can have only one Column Heading field, ...
    (microsoft.public.access.queries)
  • Re: Crosstab Breakdown
    ... it into a query or something that will give me totals for certain fields. ... Field: ShipCountry EmployeeID ... Column Heading ... Crosstab: Row Heading Row Heading ...
    (microsoft.public.access.queries)