我正在尝试找到一种方法来填充矩阵中没有数据的日期。 我现在所拥有的是
但我想展示其间的所有日期。 我尝试了几种不同的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]
Data returned with vendor names and account number blacked out
答案 0 :(得分:0)
示例:
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')
......等等
@tbMonth
与您的输出表,并按[DayOfMonth]
分组,
总和([您需要的列])