asked on
insert into #prtemp select
r.claimantId,
FY_process = ltrim(str((@lossfy -1)) + '/' + ltrim(str(@lossfy))),
total_paid = CAST(NULL AS DECIMAL(12, 2)) ,
total_incurred = SUM(CASE WHEN rt.ReserveTypeID in(SELECT Item FROM dbo.Split (@ReserveType, ',')) THEN r.ReserveAmount ELSE 0 END)
FROM dbo.Reserve r ( NOLOCK )
LEFT JOIN dbo.ReserveType rt ON r.ReserveTypeID = rt.ReserveTypeID
where r.ClaimantID = @clmnt AND r.ProcessedDate <= ('6/30/'+ltrim(str(@lossfy)))
GROUP BY r.ClaimantID
SQL (Structured Query Language) is designed to be used in conjunction with relational database products as of a means of working with sets of data. SQL consists of data definition, data manipulation, and procedural elements. Its scope includes data insert, query, update and delete, schema creation and modification, and data access control.
TRUSTED BY