Question : Datediff criteria in a query

This should be rather easy but I can't seem to figure this out.  I'm trying to  only show prior day data.  I'm using datediff and wanted to see only -1's in that column.  Everytime I place -1 for that criteria I get a "Enter Parameter Value - Closed Date"

Here is my Sql Statement:

SELECT NCTags.Name AS WT, NCTagTypes.Name AS [Tag Type], NCSecurityRoles.Name AS [Current Routing], [Closed Date by Tag (new process)].[Last Date] AS ClosedDate, FacilityEffectivityView.Effectivity AS Ship, FacilityEffectivityView.Facility, NCStatuses.Name AS Status, DateDiff("d",Date(),([ClosedDate])) AS Aging
FROM ((((NCTags INNER JOIN [Closed Date by Tag (new process)] ON NCTags.NCTagID = [Closed Date by Tag (new process)].TagID) INNER JOIN NCTagTypes ON NCTags.NCTagTypeID = NCTagTypes.NCTagTypeID) INNER JOIN NCSecurityRoles ON NCTags.NCSecurityRoleID = NCSecurityRoles.NCSecurityRoleID) INNER JOIN FacilityEffectivityView ON NCTags.NCTagID = FacilityEffectivityView.NCTagID) INNER JOIN NCStatuses ON NCTags.NCStatusID = NCStatuses.NCStatusID
WHERE (((NCTagTypes.Name) Not Like "ME" And (NCTagTypes.Name) Not Like "MRR") AND ((FacilityEffectivityView.Facility) Like "1000*") AND ((NCStatuses.Name)<>"void") AND ((DateDiff("d",Date(),([ClosedDate])))=-1));

Answer : Datediff criteria in a query

Random Solutions  
 
programming4us programming4us