A messy solution is to concatenate various values together as a string to
use as the Value in the crosstab. (This expression might be quite a long
one!)
It might be worth creating a temp table with all the columns you need (e.g.
7 totals x 8 funds would be 56 columns, plus your key column(s)), populate
the key column with an Append query, and then populate the other columns
with a series of crosstabs turned into Update queries.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"(PeteCresswell)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I've done several reports and spreadsheet-creators driven by CrossTab
> queries.
>
> e.g. A report shows totals for "funds" and we never know what or how many
> funds
> will be present. A CrossTab query sums up the XYZ field for every fund
> and
> flips the totals on their side so there's a column for each fund.
>
> Works well and is pretty quick.
>
> But now I've got a situation where we need six or seven totals for each
> fund and
> my experience so far with CrossTab queries is that such a query will only
> support one total.
>
> My fallback has been to write VBA routines to retrieve whatever totals I
> need
> on-the-fly and then plug them into the report (in this case a spreadsheet)
> as I
> compute them. As I iterate through the funds, each time I hit a new fund
> I
> feed the FundID and a couple of dates to one or more functions, and the
> functions return the totals I need..... further complicated by each row of
> the
> sheet representing a different entity which requires totals for different
> dates.
>
> That works... but it's slow as death. OK for 30-40 entities, but when it
> gets
> much over a hundred the user's going to have to take a coffee break or
> something.
>
> I should probably look to optimizing those functions... but I've also got
> to
> wonder if there are CrossTab alternatives out there - something where I
> could
> get the speed of a CrossTab query, but support many totals.
>
> First thing that occurred to me was cascading a half-dozen CrossTab
> queries...
> but at the time that was uncharted waters and I needed to get on with the
> project.
>
> Now I've got some deadline slack and I'm wondering if I should retrofit a
> better
> solution.
>
> Suggestions?
> --
> PeteCresswell