Fathers,
Actually (now it is related to original question) I would not use a query with 36 calculated fields. Characters to count (in Klingon, Esperanto or even in Shakespare's Talk) could be stored in an additional table. This table could be joined using cartesian join with the target table to produce all possible combinations of [text] and [character] which are used to calculate character ocurence count. Thus obtained dataset could be used as a source for crosstab query.
Query: qryCount
Query: qryCrosstab
Actually (now it is related to original question) I would not use a query with 36 calculated fields. Characters to count (in Klingon, Esperanto or even in Shakespare's Talk) could be stored in an additional table. This table could be joined using cartesian join with the target table to produce all possible combinations of [text] and [character] which are used to calculate character ocurence count. Thus obtained dataset could be used as a source for crosstab query.
Query: qryCount
Code:
SELECT tbl.txt, tblChars.txtChar, Len(tbl.txt)-Len(Replace(tbl.txt, tblChars.txtChar, "",1,-1,1)) AS lngCount FROM tbl, tblChars;
Code:
TRANSFORM First(qryCount.lngCount) AS lngCount SELECT qryCount.txt FROM qryCount GROUP BY qryCount.txt PIVOT qryCount.txtChar;
Comment