S
Susan L
I'm trying to set up a cross tab to report "valid", "invalid" and "total"
transactions (rows) by month (columns). I have a form on which a user can
select a date, but in truth, the date parameter will always start with
January 1 of the current year. (So maybe I could use "DateSerial(Year(Date),
1, 1)" as criteria -- but i don't know where to put it.)
Here is the SQL for the query as it now stands -- and which is not working.
It shows what I want to be rows as columns.
PARAMETERS [Forms]![frm_Generate_Reports]![txtStartDate] DateTime;
TRANSFORM Max(qry_ValidationByMonth.STDT) AS MaxOfSTDT
SELECT qry_ValidationByMonth.VLD_TXN_CNT AS Valid,
qry_ValidationByMonth.IVLD_TXN_CNT AS Invalid, qry_ValidationByMonth.Total
FROM qry_ValidationByMonth
GROUP BY qry_ValidationByMonth.VLD_TXN_CNT,
qry_ValidationByMonth.IVLD_TXN_CNT, qry_ValidationByMonth.Total
PIVOT "Mth" &
DateDiff("m",[STDT],[Forms]![frm_Generate_Reports]![txtStartDate]) In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
I don't know how to define the value -- have used the STDT (date) and have
tried count, max, first. Maybe i need an expression? Am baffled -- always get
stuck on the value part of a crosstab.
Another factor to know about is that for the first 5 months of this year,
the data were totalled manually by month, so there is only one entry per
month in the table. Starting in June and from here forward, there will be
daily data, which will then be summarized by the month in the query. I think
this is not relevant to my issue, but thought you should know.
Would appreciate any help you can provide. Thanks.
transactions (rows) by month (columns). I have a form on which a user can
select a date, but in truth, the date parameter will always start with
January 1 of the current year. (So maybe I could use "DateSerial(Year(Date),
1, 1)" as criteria -- but i don't know where to put it.)
Here is the SQL for the query as it now stands -- and which is not working.
It shows what I want to be rows as columns.
PARAMETERS [Forms]![frm_Generate_Reports]![txtStartDate] DateTime;
TRANSFORM Max(qry_ValidationByMonth.STDT) AS MaxOfSTDT
SELECT qry_ValidationByMonth.VLD_TXN_CNT AS Valid,
qry_ValidationByMonth.IVLD_TXN_CNT AS Invalid, qry_ValidationByMonth.Total
FROM qry_ValidationByMonth
GROUP BY qry_ValidationByMonth.VLD_TXN_CNT,
qry_ValidationByMonth.IVLD_TXN_CNT, qry_ValidationByMonth.Total
PIVOT "Mth" &
DateDiff("m",[STDT],[Forms]![frm_Generate_Reports]![txtStartDate]) In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
I don't know how to define the value -- have used the STDT (date) and have
tried count, max, first. Maybe i need an expression? Am baffled -- always get
stuck on the value part of a crosstab.
Another factor to know about is that for the first 5 months of this year,
the data were totalled manually by month, so there is only one entry per
month in the table. Starting in June and from here forward, there will be
daily data, which will then be summarized by the month in the query. I think
this is not relevant to my issue, but thought you should know.
Would appreciate any help you can provide. Thanks.