Это может помочь ...
DECLARE @Temp TABLE
(
Id INT IDENTITY(1,1),
[Date] DATE,
[Desc] VARCHAR(100),
DR DECIMAL(18,2),
CR DECIMAL(18,2),
Balance DECIMAL(18,2)
)
INSERT INTO @Temp(Date,[Desc],DR,CR,Balance) VALUES ('15-May-19','Service loans',1000,0,1000)
INSERT INTO @Temp(Date,[Desc],DR,CR,Balance) VALUES ('15-May-19','Service loans',2000,0,3000)
INSERT INTO @Temp(Date,[Desc],DR,CR,Balance) VALUES ('16-May-19','Service loans',5000,0,8000)
INSERT INTO @Temp(Date,[Desc],DR,CR,Balance) VALUES ('17-May-19','Service loans',3000,0,11000)
INSERT INTO @Temp(Date,[Desc],DR,CR,Balance) VALUES ('18-May-19','Service loans',0,1000,10000)
DECLARE @FromDate DATE = '16-May-19'
DECLARE @ToDate DATE = '18-May-19'
;WITH Lastbalance
AS(
SELECT TOP(1) Date,'Balance >>>' [Desc],'--'DR,'--'CR,Balance
FROM @Temp
WHERE Date = dateadd(day,-1, cast(@FromDate as date))
ORDER BY Id DESC
)
SELECT * FROM Lastbalance
UNION
SELECT Date,[Desc],CAST(DR as VARCHAR(10)) DR,CAST(CR as VARCHAR(10)) CR,Balance
FROM @Temp
WHERE Date >= @FromDate AND Date <= @ToDate