Re: Duplicate records
- From: Ralf Jansen <Ralf.Jansen@xxxxxxxxxxxxxxxx>
- Date: Fri, 31 Mar 2006 19:54:41 +0200
P.S.Bell schrieb:
I had a query with a sum on a detail field. This was fine until I found I needed to apply proper rounding prior to summing. It now lists a row for each detail record. I have guessed/tried to add the case to the group by instead of the field but I am told I cannot have a subclause.[...]
Pat Bell
CASE is not possible in the GROUP BY.
You should put the rounding algorithm inside a stored function, so
that you can simply call SUM(dbo.MYROUND(ItemActions.VatTotalSales)).
That one can be put into the GROUP BY clause.
Ralf
.
- References:
- Duplicate records
- From: P . S . Bell
- Duplicate records
- Prev by Date: Re: Dynamically Adding an Index to a query
- Next by Date: Re: dbGo in Delphi 2006
- Previous by thread: Duplicate records
- Index(es):