Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
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.7k 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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...