Question: CREATE FUNCTION fnDateRange ( @DateMin varchar ( 5 0 ) = NULL, @DateMax varchar ( 5 0 ) = NULL ) RETURNS TABLE As RETURN

CREATE FUNCTION fnDateRange ( @DateMin varchar(50)= NULL, @DateMax varchar(50)= NULL)
RETURNS TABLE
As
RETURN
(
SELECT InvoiceNumber, InvoiceDate, InvoiceTotal, InvoiceTotal - CreditTotal - PaymentTotal AS Balance
FROM Invoices WHERE InvoiceDate BETWEEN @DateMin AND @DateMax
);
GO Invoke this funtion from within a SELECT statement to return those invoices with InvoiceDate between October 10 and October 20,2019.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!