0 votes
1 view
in SQL by (20.3k points)

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 ...

1 Answer

0 votes
by (40.3k points)

Refer to this video to understand USER Defined Functions in detail.

Use Alias name and try this code:

SELECT dbo.GetBusinessDays(a.opendate,a.closedate) as BusinessDays

FROM account a

WHERE...

Related questions

+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...