I'm using the query to build the crosstab. Here is what I've done.
I have the query "qryBillingDetailRank" which uses the code you provided me:
[code]
SELECT [billingid], [modifier], (SELECT Count(*) FROM tblBillingDetail WHERE billingid = billingdetailrank.billingid AND modifier <= billingdetailrank.modifier) AS Rank
FROM tblBillingDetail AS billingdetailrank; [code]
then I build a crosstab on using the qryBillingDetailRank.
[code]
TRANSFORM First(qryBillingDetailRank.modifier) AS FirstOfmodifier
SELECT qryBillingDetailRank.billingid, First(qryBillingDetailRank.modifier) AS [Total Of modifier]
FROM qryBillingDetailRank
GROUP BY qryBillingDetailRank.billingid
PIVOT qryBillingDetailRank.Rank; [code]
When I run it, I get the message "the microsoft jet database engine does not recognize "billingdetailrank.billingid" as a valid field name or expression.
billingdetailrank.billingid is in the first query.
Is my problem that I have to make a table and run the crosstab on the table and not the query?
I truly appreciate your help. HZ
Quote:
Originally Posted by Rabbit
You shouldn't be using x.billingid in your crosstab unless your query is actually named x. Don't confuse the alias with the name of your query.