count summary question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query that returns a list of transactions and dates and currencies
(plus various other fields) . (amount, ccy, sdate etc)
I am trying to buid query that tells me the count of all transactions that
are within the last 30 days, split by ccy.

I'm using the count(*), and date()-30 to get an overall result, but i cant
seem to get one query that will give me this seeming simple thing!!!]

any help greatly appreciated,
 
There maybe a shorter way

Creat a qurey say q Trans List Witha dummy field say, ccyCount="Count"

SELECT tblTrans.sDate, tblTrans.ccy, "Count" AS ccyCount, tblTrans.Amount
FROM tblTrans
WHERE (((tblTrans.sDate)>=Date()-30 And (tblTrans.sDate)<=Date()))
ORDER BY tblTrans.sDate;

Then Creat a CrossTab query

TRANSFORM Count([q Trans List].Amount) AS CountOfAmount
SELECT [q Trans List].ccy
FROM [q Trans List]
GROUP BY [q Trans List].ccy
PIVOT [q Trans List].ccyCount;

Regards/JK
 
In the criteria line for the date field you want something like
Between [Enter Start Date] and [Enter End Date]

HTH
 
Larry,

Arran already said that he want to see the last 30 days, therefore the
prompts are not required, The WHERE clause above covers this

Regards/JK



Larry Daugherty said:
In the criteria line for the date field you want something like
Between [Enter Start Date] and [Enter End Date]

HTH
--
-Larry-
--

arran1180 said:
I have a query that returns a list of transactions and dates and currencies
(plus various other fields) . (amount, ccy, sdate etc)
I am trying to buid query that tells me the count of all transactions that
are within the last 30 days, split by ccy.

I'm using the count(*), and date()-30 to get an overall result, but i cant
seem to get one query that will give me this seeming simple thing!!!]

any help greatly appreciated,
 

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

Back
Top