I am trying to find a way to fill dates that have no data in a matrix. What I have right now is below
But I want to show all the dates in between as well. I have tried several different iif statements but I either get errors or no change.
SELECT ee.No, TTMain.CustFn, me.Date_Opened AS [I Open], me.Date_Closed AS [I Sch Close], TTMain.ttfn00,
ee.Cls_Date AS [Actual Close Date], ee.Open_Date, TTMain.Project
FROM GreatAmerican_Data.dbo.Marketing_Escrow AS me INNER JOIN
GreatAmerican_Data.dbo.Escmst_Escrow AS ee ON me.File_Number = ee.No INNER JOIN
ttMain AS TTMain ON ee.No = TTMain.ZeroZerottfn
WHERE (ee.Branch = '018') AND (me.Date_Opened Between '2/1/16' AND GETDATE()) AND (ee.Status_Date IS NULL)
ORDER BY [I Sch Close]
Data returned with vendor names and account number blacked out
Marco Bong
- Declare Months table with full date of month
Example:
declare @tbMonth as Table (DayOfMonth nvarchar (10))
insert into @tbMonth ('01 Feb')
insert into @tbMonth ('02 Feb')
insert into @tbMonth ('03 Feb')
insert into @tbMonth ('04 Feb')
... and so on
- union
@tbMonth
with your output table, and group by[DayOfMonth]
, Sum([Your required columns]) - Done.
来源:https://stackoverflow.com/questions/35468564/fill-empty-dates-in-a-matrix-ssrs