Report/query

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

Guest

I have a report thats in the format below.

Class Code amt
a 4 $25
b 6 $10
a 4 $10
b 1 $5

I want it to look like this

Class Code amt
a 4 $35
b 6 $10
b 1 $5

Im not too sure about what query to use.
 
Set Sort to Ascending for the Class field in the query on which the report is
based.
--
***************************
If the message was helpful to you, click Yes next to Was this post helpful
to you?
If the post answers your question, click Yes next to Did this post answer
the question?
 
The SQL statement that is bound to the report would look like

SELECT Class, Code, Sum(Amt) as SumOfAmt
FROM [YourTableName]
GROUP BY Class, Code

Open the query
Select View: Totals from the Menu
Under Amt change the Total from "Group by" to "Sum"

In the report, select the Amt control and select the new name for the
field - probably "SumOfAmt".
 
Im not too sure about what query to use.

Try:

SELECT Class, Code, SUM(tblClassCodes.Amt) AS Amt
FROM tblClassCodes
GROUP BY Class, Code
ORDER BY Class, Code DESC;

.. . . where tblClassCodes is the name of the table.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
tope12 said:
I have a report thats in the format below.

Class Code amt
a 4 $25
b 6 $10
a 4 $10
b 1 $5

I want it to look like this

Class Code amt
a 4 $35
b 6 $10
b 1 $5

Im not too sure about what query to use.


Use a Totals type query (View menu) set the Class and Code
Total line to Group By and set the amt total line to Sum.
 
Back
Top