 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
afm Guest
|
Posted: Mon Jul 12, 2004 8:47 pm Post subject: Sql Aggregate Expression to find % difference betwen two col |
|
|
I have a table including columns for Quantities_Bought and Quantities_Sold.
I am trying to find an sql expression which will give me the ratio of the
Sum(Quantity_Sold) / Sum(Quantity_Bought). I have tried:
SELECT Sum(Answer2.Qty_Bought) AS SumOfQty_Bought, Sum(Answer2.Qty_Sold) AS
SumOfQty_Sold, Sum([Qty_sold]/[Qty_Bought]) AS [Percentage Sold]
FROM Answer2;
On a test table the results came out:
Bought Sold Sold/Bought
110 55 5.5 ( ?)
I need to use the expression in an Orpheus Reportview component.
Many thanks for any help.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|