dbo.fn_StakeDiff

Syntax:
dbo.fn_StakeDiff(id_race, id_horse, price1, price2)

Output:
(decimal) Returns the sum of pending stakes between price1 and price2, for the race and the horse specified. Unmatched bets placed by Ipposnif are not included.

Input parameters:
id_race (integer)Id of the market.
id_horse (integer)Id of the runner.
price1 (decimal)First price of the range.
price2 (decimal)Second price of the range.

Example:

select dbo.fn_StakeDiff(@id_race, @id_horse, 2.4, 2.9)
can return 12000.75