Agregate Issue

May 4, 2008

Hi there

I am trying to figure out this query below to displaying in the RS:

ORDERBY, SECTIONAREA, RATE, VALUE
1, AREA1, 'Rate1', $10
2, AREA1, 'Rate2', $11
3, AREA2, 'Rate3', $20
4, AREA2, 'Rate4', $21

I've managed to display into RS as follow by putting grouping for SECTIONAREA field and SUM the VALUE field and turns out ok:

AREA1
Rate1 | $10
Rate2 | $11
Total Area1 | $21

AREA2
Rate3 | $20
Rate4 | $21
Total Area2 | $41

Now, I want to add extra lines which are basically TAX and TOTAL COST so it will be like this:

AREA1
Rate1 | $10
Rate2 | $11
Total Area1 | $21

AREA2
Rate3 | $20
Rate4 | $21
Total Area2 | $41

TAX | (Total Area1 + Total Area2) * 0.1

TOTAL COST | (Total Area1 + Total Area2) * 1.1

Any ideas? I am not sure how to add a new line for handling TAX and TOTAL COST. I can probabaly put every detail as a data set in RS or built another data set and stick in but that but that's defeat the purpose ... I guess.

I am appreciated your commment.

Thank you

View 2 Replies


ADVERTISEMENT

Decimals With Sum Agregate Function

Feb 23, 2001

I'm using the sum() agregate function inside a select with a decimal field with an scale of 2.
I want to get the result always with 2 decimals, but if the result is 100.10 I get 100.1 . I've tried
to convert and cast the result but I can't find how to get 2 decimals. Please help. Thanks

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved