CREATE VIEW dbo.GuaranteeCancelPolicyView AS
SELECT dtRange.IndividualDate AS View_DateStamp, MAX(Id) AS View_Id, FK_ProductNumber AS View_FK_ProductNumber
FROM GuaranteeCancelPolicy WITH (NOLOCK) 
CROSS APPLY dbo.DateRange(GuaranteeCancelPolicy.StartDate, GuaranteeCancelPolicy.EndDate, 0) AS dtRange
GROUP BY dtRange.IndividualDate, FK_ProductNumber