Hi everybody,
I have a page with Search User Control. This User Control allows to search by Name, by Description and by Date. It also has Operator, which may be set to Equal, Less than or Greater than. In addition is has a DropDown option of All (Events & Programs), Events Only, Programs Only.
Also when I start my page I use some extra where condition, which is not used once Search was used.
Right now everything is coded directly using string contatenation.
I'm thinking of moving this logic into SP with these parameters
@FirstTime bit
@EName
@EDescription
@StartTime
@EndTime
@Operator
@IncludeType
I'm guessing that I have to use 3 different paths IF ELSE IF depedning on operator.
My question here is this - does it sound reasonable to create 2 table valued functions - one for Events and one for Programs so it would be easier to use them depending on Include Type in this SP?
Or just one SP without functions may be a better choice?
I'm thinking that functions is the way to go, but need some input from experts.
Thanks in advance.
If it's not broken, fix it until it is.
My Blog