DateDiff > 10

Mike Hughes

Registered User.
Local time
Today, 09:01
Joined
Mar 23, 2002
Messages
493
I'm trying to return only records where the DateDiff is greater than 10.
I just can't seem to make it work. Would someone help please. (query shortened to take up less space) Thanks

SELECT DISTINCT
A.WORKER,
A.RUN,
A.TODAY,
=DateDiff("d", A.RUN, A.TODAY) AS DAYS

FROM [3 MATCHED ON NCP SSN] A
 
1. don't use the = sign in the query (for the select)
2. Add the WHERE clause

SELECT DISTINCT
A.WORKER,
A.RUN,
A.TODAY,
DateDiff("d", A.RUN, A.TODAY) AS DAYS

FROM [3 MATCHED ON NCP SSN] A
WHERE DateDiff("d",A.RUN, A.TODAY) > 10
 
Works, thanks
 
Works, thanks

GladWeCouldHelp.png
 

Users who are viewing this thread

Back
Top Bottom