Crosstab query with date criteria

D

Dennis Hansen

I'm trying to create a report based on a crosstab query.
I need some parameter values I can set.
The Between [start date] And [End date] works fine on
select query but
When I change to the crosstab query " the Microsoft jet
database engine
Does not recognize bla! Bla! Bla!
How can I get my report from a cross tab query to work
and have the luxury?
Of entering the dates I want.??
Thank you like so many times before.
Dennis Hansen
 
D

Duane Hookom

You must set the query parameters. Select Query|Parameters and enter
[start date] DateTime
[End date] DateTime
 
G

Guest

I can get the dates I want using the criteria, when i put
them in "between 1-1-2003 and 3-1-2003" in the cross
tab query this works, how ever I must do this for each
report on my date parameters.
when I do as was suggested in query parameters, I do get
the dia box asking for dates, but It does not filter the
date. I get all the dates.
what am I doing wrong. I am using access 97.
-----Original Message-----
You must set the query parameters. Select Query|Parameters and enter
[start date] DateTime
[End date] DateTime
--
Duane Hookom
MS Access MVP


Dennis Hansen said:
I'm trying to create a report based on a crosstab query.
I need some parameter values I can set.
The Between [start date] And [End date] works fine on
select query but
When I change to the crosstab query " the Microsoft jet
database engine
Does not recognize bla! Bla! Bla!
How can I get my report from a cross tab query to work
and have the luxury?
Of entering the dates I want.??
Thank you like so many times before.
Dennis Hansen


.
 
D

Duane Hookom

Did you leave the criteria as it was? Please post your sql view if you can't
figure this out.

--
Duane Hookom
MS Access MVP


I can get the dates I want using the criteria, when i put
them in "between 1-1-2003 and 3-1-2003" in the cross
tab query this works, how ever I must do this for each
report on my date parameters.
when I do as was suggested in query parameters, I do get
the dia box asking for dates, but It does not filter the
date. I get all the dates.
what am I doing wrong. I am using access 97.
-----Original Message-----
You must set the query parameters. Select Query|Parameters and enter
[start date] DateTime
[End date] DateTime
--
Duane Hookom
MS Access MVP


Dennis Hansen said:
I'm trying to create a report based on a crosstab query.
I need some parameter values I can set.
The Between [start date] And [End date] works fine on
select query but
When I change to the crosstab query " the Microsoft jet
database engine
Does not recognize bla! Bla! Bla!
How can I get my report from a cross tab query to work
and have the luxury?
Of entering the dates I want.??
Thank you like so many times before.
Dennis Hansen


.
 
D

Dennis Hansen

This does not work
TRANSFORM Count(History.ItemID) AS CountOfItemID
SELECT Inventory.DESC
FROM History INNER JOIN Inventory ON History.[Item#] =
Inventory.[ITEM#]
WHERE (((History.TransType)="test") AND
((History.TranDate) Between [ start date] And [end date]))
GROUP BY Inventory.DESC, History.TransType,
History.TranDate
PIVOT History.BinLoc;

but as a select it does
SELECT Inventory.DESC, History.TranDate, History.BinLoc,
Count(History.ItemID) AS CountOfItemID
FROM History INNER JOIN Inventory ON History.[Item#] =
Inventory.[ITEM#]
WHERE (((History.TransType)="test") AND
((History.TranDate) Between [ start date] And [end date]))
GROUP BY Inventory.DESC, History.TransType,
History.TranDate, History.BinLoc;
all I am doing is changeing from select to crsosstab,
assigning row and column headings with item id as value.
I was hoping to create a report like a crosstab.
thanks again
Dennis



-----Original Message-----
Did you leave the criteria as it was? Please post your sql view if you can't
figure this out.

--
Duane Hookom
MS Access MVP


I can get the dates I want using the criteria, when i put
them in "between 1-1-2003 and 3-1-2003" in the cross
tab query this works, how ever I must do this for each
report on my date parameters.
when I do as was suggested in query parameters, I do get
the dia box asking for dates, but It does not filter the
date. I get all the dates.
what am I doing wrong. I am using access 97.
-----Original Message-----
You must set the query parameters. Select Query|Parameters and enter
[start date] DateTime
[End date] DateTime
--
Duane Hookom
MS Access MVP


I'm trying to create a report based on a crosstab query.
I need some parameter values I can set.
The Between [start date] And [End date] works fine on
select query but
When I change to the crosstab query " the Microsoft jet
database engine
Does not recognize bla! Bla! Bla!
How can I get my report from a cross tab query to work
and have the luxury?
Of entering the dates I want.??
Thank you like so many times before.
Dennis Hansen



.


.
 
J

John Spencer (MVP)

Ah. You MUST declare the parameters in a crosstab query; in most other queries
the declaration is optional.

PARAMETERS [ Start Date] Datetime, [End Date] DateTime;
TRANSFORM ...

Dennis said:
This does not work
TRANSFORM Count(History.ItemID) AS CountOfItemID
SELECT Inventory.DESC
FROM History INNER JOIN Inventory ON History.[Item#] =
Inventory.[ITEM#]
WHERE (((History.TransType)="test") AND
((History.TranDate) Between [ start date] And [end date]))
GROUP BY Inventory.DESC, History.TransType,
History.TranDate
PIVOT History.BinLoc;

but as a select it does
SELECT Inventory.DESC, History.TranDate, History.BinLoc,
Count(History.ItemID) AS CountOfItemID
FROM History INNER JOIN Inventory ON History.[Item#] =
Inventory.[ITEM#]
WHERE (((History.TransType)="test") AND
((History.TranDate) Between [ start date] And [end date]))
GROUP BY Inventory.DESC, History.TransType,
History.TranDate, History.BinLoc;
all I am doing is changeing from select to crsosstab,
assigning row and column headings with item id as value.
I was hoping to create a report like a crosstab.
thanks again
Dennis
-----Original Message-----
Did you leave the criteria as it was? Please post your sql view if you can't
figure this out.

--
Duane Hookom
MS Access MVP


I can get the dates I want using the criteria, when i put
them in "between 1-1-2003 and 3-1-2003" in the cross
tab query this works, how ever I must do this for each
report on my date parameters.
when I do as was suggested in query parameters, I do get
the dia box asking for dates, but It does not filter the
date. I get all the dates.
what am I doing wrong. I am using access 97.
-----Original Message-----
You must set the query parameters. Select
Query|Parameters and enter
[start date] DateTime
[End date] DateTime
--
Duane Hookom
MS Access MVP


I'm trying to create a report based on a crosstab
query.
I need some parameter values I can set.
The Between [start date] And [End date] works fine on
select query but
When I change to the crosstab query " the Microsoft jet
database engine
Does not recognize bla! Bla! Bla!
How can I get my report from a cross tab query to work
and have the luxury?
Of entering the dates I want.??
Thank you like so many times before.
Dennis Hansen



.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top