SQL.Add('WHERE BSO.Num BETWEEN iif(:Num_Start is null, Num, :Num_Start) and iif(:Num_End is null, Num, :Num_End)' );