Hi all
Long time since I last posted in here!!!
I have spent the last few hours trying to find a solution to an issue I am having with an XTab query, but to no avail, so was wondering if anyone else could cast their eye over it to see if it is even possible (I am thinking it might not be).
I have an XTab based on a set of date range parms, and have it defined such that each day has a count of a unique ID in its own column, all good. However if there is no data for that day, the column doesn't appear.
My SQL:
Now I know you can statically define the column headers in the PIVOT clause, eg.
and that would be great if the parms range was always the same distance, but this report will be run for a variety of ranges of days from just a week to month and all combinations inbetween.
I was thinking of doing some kind of subquery i.e.
but am not sure where to proceed from there.
Is what I am after possible? If so could anyone perchance point me in the right direction please? I've been agonising over this for hours, I've read Duane's article, many posts on this forum and others, but everyone else who has encountered XTab column issues wants to define theirs over a fixed range i.e. 12 months, not a dynamic one based on parms.
Thanks for taking the time to read this, looking forward to any responses that might appear!!!
All the best
James
Long time since I last posted in here!!!
I have spent the last few hours trying to find a solution to an issue I am having with an XTab query, but to no avail, so was wondering if anyone else could cast their eye over it to see if it is even possible (I am thinking it might not be).
I have an XTab based on a set of date range parms, and have it defined such that each day has a count of a unique ID in its own column, all good. However if there is no data for that day, the column doesn't appear.
My SQL:
Code:
PARAMETERS [forms]![frmRep1]![textFrom] Text ( 255 ), [forms]![frmRep1]![textTo] Text ( 255 );
TRANSFORM Count(qryGetValidCalls.callid) AS CountOfcallid
SELECT "Calls Offered" AS Assessment
FROM qryGetValidCalls
WHERE (((qryGetValidCalls.realcallstart) Between CDate([forms]![frmRep1]![textFrom]) And (1+CDate([Forms]![frmRep1]![textTo]))))
GROUP BY "Calls Offered"
PIVOT qryGetValidCalls.calldate;
Now I know you can statically define the column headers in the PIVOT clause, eg.
Code:
PIVOT qryGetValidCalls.calldate in ("01/01/2000", "02/01/2000")
and that would be great if the parms range was always the same distance, but this report will be run for a variety of ranges of days from just a week to month and all combinations inbetween.
I was thinking of doing some kind of subquery i.e.
Code:
PIVOT qryGetValidCalls.calldate in (SELECT ......)
but am not sure where to proceed from there.
Is what I am after possible? If so could anyone perchance point me in the right direction please? I've been agonising over this for hours, I've read Duane's article, many posts on this forum and others, but everyone else who has encountered XTab column issues wants to define theirs over a fixed range i.e. 12 months, not a dynamic one based on parms.
Thanks for taking the time to read this, looking forward to any responses that might appear!!!
All the best
James