I am constructing custom sql reports for our offices and have found my equations dont match those found in the standard monthly (day by day) Production and Income report. Particularly the 'Ins Income' numbers. I was wondering if I might be able to see the whole sql syntax used for that report or an explanation of how each of the (noncomputed) fields are pulled. Below is how I pull them and it never matches the report and I dont know why.
Ins Income:
Code: Select all
SET @FromDate='2022-1-1' , @ToDate='2022-1-31';
SELECT SUM(InsPayAmt)
FROM claim
WHERE ClinicNum =1
AND DateReceived BETWEEN @FromDate AND @ToDate
AND InsPayAmt != 0;
Any help you could provide would be greatly appreciated.