[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: See Data



>Here's what I need to do:

>1. Calculate a total amount for fields with identical ID, Description and
>Date
>2. Print the ID, Date, Date and Amount.

I may be missing something but this SQL would give you the grouping/totaling
you describe.  The &Total is just to assign an  alias to the sum result.  Try
this:

begin-select
ID
DESCR
DATE
SUM(AMOUNT)  &Total
        show &ID ' ' &DESCR  ' ' &DATE  ' ' &Total
        ...other processing ...
FROM TABLENAME
GROUP BY ID, DESCR, DATE
end-select