HOW 2 MAKE AN ALIAS?

F

Faraz A. Qureshi

I have a crosstab query as follows:

TRANSFORM Sum(NwTbl.AMT) AS SUMAMOUNT
SELECT NwTbl.ACC, NwTbl.DT
FROM (SELECT DT, DR AS ACC, AMT, "CR" AS AMOUNT FROM TRANS
UNION ALL
SELECT DT, CR AS ACC, AMT, "DR" AS AMOUNT FROM TRANS) AS NwTbl
GROUP BY NwTbl.ACC, NwTbl.DT
ORDER BY NwTbl.ACC, NwTbl.DT
PIVOT NwTbl.AMOUNT;

How to give it a name so as to use it's calculated fields:
ACC
DT
DR
CR

in a SELECT Query as a single piece of Code, instead of saving it and using
the same in another query?
 

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