小编典典

在矩阵SSRS中填写空日期

sql

我正在尝试找到一种方法来填充矩阵中没有数据的日期。

但我也想显示两者之间的所有日期。我尝试了几种不同的iif语句,但是我得到了错误或没有任何变化。

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]

阅读 214

收藏
2021-04-15

共1个答案

小编典典

  1. 声明月份表以及月份的完整日期

例子:

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')

… 等等

  1. 工会@tbMonth与产出表和group by [DayOfMonth],SUM([你需要列])
  2. 完毕。
2021-04-15