Re: Aggregate function, Grouping



How about this:
SELECT
bl.GR_KEY, bl.GroupOrder, bl.UseOverhead,
SUM (Amount * price) as "SubTotal",
SUM(IIF (bl.UseClientAmount = True,
bl.Amount + bl.ClientAmount,
bl.Amount)) as "RealAmount"
FROM
Budget_Lines bl
WHERE
bl.BU_KEY = :BU_KEY
GROUP BY
bl.BU_KEY, bl.GroupOrder, bl.UseOverhead, bl.GR_KEY


.



Relevant Pages

  • Aggregate function, Grouping
    ... SUM (Amount * price) as "SubTotal", ... IIF (bl.UseClientAmount = True, ... bl.Amount) as "RealAmount" ...
    (borland.public.delphi.database.ado)
  • Re: Aggregate function, Grouping
    ... Vitali Kalinin wrote: ... SUM (Amount * price) as "SubTotal", ...
    (borland.public.delphi.database.ado)
  • Re: Summing totals if record satisfy criteria
    ... slot as well as the amount of hours on that project. ... "Duane Hookom" wrote: ... >> I have a query that displays certain information based on a form. ... >> to sum totals for certain information from the query. ...
    (microsoft.public.access.queries)
  • Re: Form calculation is not working
    ... And I want to appear in the unbound box, the sum of the two in this ... OrderDetails contains a field called Price. ... You cannot sum a calculated control, but you can sum the calculation ...
    (microsoft.public.access.forms)
  • Re: Form calculation is not working
    ... And I want to appear in the unbound box, the sum of the two in this case ... OrderDetails contains a field called Price. ... You cannot sum a calculated control, but you can sum the calculation ...
    (microsoft.public.access.forms)