Question: Only need help with Exercise 6 & 7 below Exercise 3 (only for reference to Exercise 6) Create a table-valued function named fnDateRange, similar to
Only need help with Exercise 6 & 7 below
Exercise 3 (only for reference to Exercise 6) Create a table-valued function named fnDateRange, similar to the stored procedure of exercise 3. The function requires two parameters of data type smalldatetime. Dont validate the parameters. Return a result set that includes the InvoiceNumber, InvoiceDate, InvoiceTotal, and Balance for each invoice for which the InvoiceDate is within the date range. Invoke the function from within a SELECT statement to return those invoices with InvoiceDate between December 10 and December 20, 2015.
6. Create a table-valued function named fnDateRange, similar to the stored procedure of exercise 3. The function requires two parameters of data type smalldatetime. Dont validate the parameters. Return a result set that includes the InvoiceNumber, InvoiceDate, InvoiceTotal, and Balance for each invoice for which the InvoiceDate is within the date range. Invoke the function from within a SELECT statement to return those invoices with InvoiceDate between December 10 and December 20, 2015.
7. Use the function you created in exercise 6 in a SELECT statement that returns five columns: VendorName and the four columns returned by the function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
