I think I've managed to do this before in an earlier version, but can't seem to manage it at the moment.
I'm using dbo.fn_GetPrice(@id_race, @id_favourite_[n], 'b',1) to get the best price for the top three runners as part of a dutching strategy, but this obviously only works for the top 3.
What I want to be able to do is use dbo.fn_GetPrice(@id_race, @position_1=[n], 'b',1), but that returns a syntax error.
Basically, I can't work out how to get the id of a horse outside of the top 3 using the existing functions and variables, and I think I have been able to before, and it's doing my head in. Is there a way to get these ids, or is there a way to extend the favourites variable beyond 3?