UFN_VALIDCATEGORYRANGE

This function checks if the category range is valid against existing account codes.

Return

Return Type
int

Parameters

Parameter Parameter Type Mode Description
@FromCode varchar(30) IN
@ToCode varchar(30) IN
@Category bit IN

Definition

Copy


CREATE function dbo.UFN_VALIDCATEGORYRANGE(@FromCode varchar(30), @ToCode varchar(30), @Category bit) returns int
as
begin
    declare @count int;
    select @count = COUNT(a.ID) from accountcode as a join dbo.PDACCOUNTSEGMENTVALUE as b
  on a.ID = b.ID
  where categorycode = 0
    return @count;
end