C# 3.5, LLBLGen 2.6, SelfServicing
Hi,
I want to do a scalar function with a calulated field, but have no clue where to start.
I've got a table to track purchases (always for the same item, therefore no Product) with the following columns: Quantity & Price.
What I want to get out of the table is the average price per unit bought.
I can only describe my formula, for which I want to get the LLBLGen code, like this:
'Get the sum of Quantity*Price of each row and divide it by the sum of Quantity for all rows.'
Of course it's easy to do this in code, but I prefer to get it directly queried from the DB.
Any suggetions?
Thanks,
Gab