Crosstab Havack

D

DavidW

I need to limit a qtr crosstab query to only one qtr I think.
What my problem is that I have got other data that is being calculated in
the query, example of rows
mileage - min
mileage - max
total miles - sum
I am using total gallons (sum) for the crosstab columns
if I use the data as is , it will be for the whole table
how do you limit, (or is the the wrong ideal), a crosstab to only 3 months
so that the other data will equal the qtr.?
If this can be done ,I will have to make 3 other queries for the other 3
quarters.
thanks
David
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You need a WHERE clause on your cross-tab query. E.g. Look at the SQL
view of your cross-tab query and put in something like this:

PARAMETERS [Begin Date?] Date, [End Date?] Date;
TRANSFORM ... <keep original transform query>
FROM ...
WHERE DateColumn Between [Begin Date?] And [End Date?]
GROUP BY ...

You can set the [Begin Date?] and [End Date?] parameters to whatever
dates you want: weeks, months, quaters, years, etc.

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQCQbJYechKqOuFEgEQJ0iQCdHW2ihpgHja6mcQPWvh4rybXGkmoAoLcf
NWBHw9771iwOPEZQZJrVLXe8
=9z7Q
-----END PGP SIGNATURE-----
 

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