I have a user defined function in SQL called getBuisnessDays it takes @startdate and @enddate and returns the number of business days between the two dates. How can I call that function within my select?
Here's what I'd like to do..
SELECT getBusinessDays(a.opendate,a.closedate)
FROM account a
WHERE ...
Yes, you can do almost that:
Use a scalar-valued UDF, not a table-value one, then you can use it in a SELECT as you want.
If it's a table-value function (returns a table set) you simply join it as a Table
this function generates one column table with all the values from passed comma-separated list