I have below Stored Procedure . I want YTd column value also.
If user enters @frDate = 01/01/2021 and @toDate = 31/01/2021 then YTD value should be from 01/04/2020 to 31/01/2021
If user enters @frDate = 01/12/2020 and @toDate = 31/12/2020 then YTD value should be from 01/04/2020 to 31/12/2020
Create PROCEDURE [dbo].[SpBpGroupWiseSalePurchase]
(Select sum(INvTotal) from Invoice where dt between @frDate and @ToDate ) as "Total Sales"
from InvoiceHeader T0