How can I get data for a pivot table using a date range?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I put a date range on my query then try to create a pivot table with
that query I will get an error, "Problems obtaining Data". How can the pivot
table prompt the date range field parameters before creating the pivot table?
 
EWD said:
When I put a date range on my query then try to create a pivot table with
that query I will get an error, "Problems obtaining Data". How can the pivot
table prompt the date range field parameters before creating the
pivot table?

EWD,

Crosstab queries require that all parameters be declared.

The top line of the SQL (menus: View > SQL View) must be:

PARAMETERS StartDate DATETIME
,EndDate DATETIME;
TRANSFORM <a column>
SELECT <a column>
FROM <a table>
WHERE <a date column> BETWEEN
[StartDate] AND [EndDate]
GROUP BY <a column>
PIVOT <a column>


Change the names of the parameters to whatever you are using and add
your column and tables names, as appropriate.

Note: Without your table structures, sample data, and SQL code, the
above is only my best guess, and does not represent a tested a
solution.


Sincerely,

Chris O.
 
Back
Top