Re: Report based on Crosstab with dates changing daily
From: SMac (SMac_at_discussions.microsoft.com)
Date: 01/19/05
- Next message: Ian Belcher: "Re: 75 percentile value"
- Previous message: Fons Ponsioen: "RE: Counting Number of Records Related to a Parent Table"
- In reply to: Duane Hookom: "Re: Report based on Crosstab with dates changing daily"
- Next in thread: Duane Hookom: "Re: Report based on Crosstab with dates changing daily"
- Reply: Duane Hookom: "Re: Report based on Crosstab with dates changing daily"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 19 Jan 2005 07:51:13 -0800
The following is my SQL:
TRANSFORM Sum(qry_Sum_for_rpt_NPLC_Eye_Chart.SumOfQty_of_Defect) AS
SumOfSumOfQty_of_Defect
SELECT qry_Sum_for_rpt_NPLC_Eye_Chart.Defect_Reason
FROM qry_Sum_for_rpt_NPLC_Eye_Chart
GROUP BY qry_Sum_for_rpt_NPLC_Eye_Chart.Defect_Reason,
qry_Sum_for_rpt_NPLC_Eye_Chart.Mold_Number
ORDER BY qry_Sum_for_rpt_NPLC_Eye_Chart.Occurrence_Date
PIVOT qry_Sum_for_rpt_NPLC_Eye_Chart.Occurrence_Date;
I get where you are going but the only problem is the user doesn't enter a
date, instead off a form they choose criteria as far as Customer, Program,
Mold#, Plant and Time Frame - all are combo boxes. There is a box that has
today's date on the form also. I was wondering if we could use this somehow
instead of [EndDate] - somehow figure out the month based off the current day
or something?
Much appreciated!!
-S
"Duane Hookom" wrote:
> You can use relative dates as column headings in your crosstab. Assuming you
> want a specific number of dates (28 for example) that end on a date entered
> in a text box (Forms!frmDate!txtEndDate). Since we don't know the SQL of
> your query or name of the date field, assume it is [DefectDate].
>
> Set the column heading expression to:
> ColHead:"D" & DateDiff("d",[DefectDate],Forms!frmDate!txtEndDate)
> Then set the column headings property to:
> D0,D1,D2,...D27
> This will create 28 columns with D0 being the end date from the form
> control. D27 will be 27 days earlier.
>
> To create column labels in your report, use text boxes with control sources
> like:
> =DateAdd("d", 0,Forms!frmDate!txtEndDate)
> =DateAdd("d", -1,Forms!frmDate!txtEndDate)
> =DateAdd("d", -2,Forms!frmDate!txtEndDate)
> =...
> =DateAdd("d", -27,Forms!frmDate!txtEndDate)
>
> --
> Duane Hookom
> MS Access MVP
>
>
> "SMac" <SMac@discussions.microsoft.com> wrote in message
> news:9504E35A-19CB-481D-9B12-A444481D4CBB@microsoft.com...
> >I have a query that gives the following data:
> >
> > Defect Reason 1/3 1/4 1/5 1/6 1/7
> > Blush 2 5
> > Shine 1 1 1
> > Wax 4 4
> >
> > Then I created the report, problem is data is going to be added daily and
> > then when the new month starts it will do February and so on.
> >
> > How do I get the report to automatically see the new date and data?
> >
> > THANKS!!
> > Stacey
>
>
>
- Next message: Ian Belcher: "Re: 75 percentile value"
- Previous message: Fons Ponsioen: "RE: Counting Number of Records Related to a Parent Table"
- In reply to: Duane Hookom: "Re: Report based on Crosstab with dates changing daily"
- Next in thread: Duane Hookom: "Re: Report based on Crosstab with dates changing daily"
- Reply: Duane Hookom: "Re: Report based on Crosstab with dates changing daily"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|