in Education by
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 ... Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
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

0 votes
    I have a user defined function in SQL called getBuisnessDays it takes @startdate and @enddate and returns the number of ... WHERE ... Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    In SQL Server, it's possible to insert into a table using a SELECT statement: INSERT INTO Table (col1, col2, ... .id = other_table.id Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    How do I perform an IF...THEN in an SQL SELECT statement? For example: SELECT IF(Obsolete = 'N' OR ... Saleable, * FROM Product Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    I have written an SQL script which runs fine when executed directly in SQL Management Studio. However, when entering ... are removed: Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I have a SQL column with a length of 6. Now want to take only the first char of that column. Is there any ... in SQL to do this? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I didn't see any similar questions asked on this topic, and I had to research this for something I'm working ... had the same question. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I have a SQL column with a length of 6. Now want to take only the first char of that column. Is there any ... in SQL to do this? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I didn't see any similar questions asked on this topic, and I had to research this for something I'm working ... had the same question. Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    Just wondering if any of you guys use Count(1) over Count(*) and if there is a noticeable difference in ... SQL Server 2005.) Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    I need to remove a highly referenced table in a SQL Server database. How can I get a list of all the ... of the management studio.) Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    I have seen SQL that uses both != and for not equal. What is the preferred syntax and why? I like !=, ... reminds me of Visual Basic. Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    SELECT GETDATE() Returns: 2008-09-22 15:24:13.790 I want that date part without the time part: 2008-09-22 00: ... How can I get that? Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    Consider a database table holding names, with three rows: Peter Paul Mary Is there an easy way to turn this into ... Peter, Paul, Mary? Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    I have multiple set of data to insert at once, say 4 rows. My table has three columns: Person, Id and ... a single SQL statement? Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    I have multiple set of data to insert at once, say 4 rows. My table has three columns: Person, Id and ... a single SQL statement? Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
...