UFN_MKTASKLADDER_ORGANIZATIONNEXTMINIMUMENTRYAMOUNT

Returns the next highest organization minimum entry amount for an ask ladder.

Return

Return Type
decimal(20, 4)

Parameters

Parameter Parameter Type Mode Description
@ASKLADDERID uniqueidentifier IN
@ORGANIZATIONMINIMUMENTRYAMOUNT decimal(20, 4) IN

Definition

Copy


create function dbo.[UFN_MKTASKLADDER_ORGANIZATIONNEXTMINIMUMENTRYAMOUNT]
(
  @ASKLADDERID uniqueidentifier,
  @ORGANIZATIONMINIMUMENTRYAMOUNT decimal(20, 4)
)
returns decimal(20, 4)
as 
  begin
    declare @VALUE decimal(20, 4);

    set @VALUE = 9999999999.9999;

    select top 1 
      @VALUE = [ORGANIZATIONMINIMUMENTRYAMOUNT] 
    from dbo.[MKTASKLADDERITEM] 
    where [ASKLADDERID] = @ASKLADDERID 
    and [ORGANIZATIONMINIMUMENTRYAMOUNT] > @ORGANIZATIONMINIMUMENTRYAMOUNT 
    order by [ORGANIZATIONMINIMUMENTRYAMOUNT];

    return @VALUE
  end