Add Date filter to Advert status

SELECT 
CS.Name0,
adv.AdvertisementName,
stat.LastStateName,
adv.Comment AS C072,
pkg.Name AS C062,
adv.ProgramName AS C071,
adv.SourceSite,
adv.AdvertisementID
FROM
v_Advertisement adv
JOIN v_Package pkg ON adv.PackageID = pkg.PackageID
JOIN v_ClientAdvertisementStatus stat ON stat.AdvertisementID = adv.AdvertisementID
JOIN v_GS_Computer_System CS ON stat.ResourceID = cs.ResourceID
WHERE
— sys.Resource_Domain_OR_Workgr0 LIKE ‘IR’
and stat.laststatename = ‘succeeded’
and datediff(dd,stat.LastStatusTime, ‘2007-12-09’) = 0
ORDER BY
CS.Name0 ASC,
adv.AdvertisementName

Leave a Reply

Your email address will not be published. Required fields are marked *