Access SQL DateDiff
I have the following to get all fields from table tblMain, where the field AuditChecked is more than
one year ago from today.
However I believe my DateDiff part is not formatted correctly, and is therefore not returning values.
The field AuditChecked is a text field in the table, holding a date value. Therefore I have the CDate(AuditChecked)
as part of the SQL statement.
Any tips sincerely appreciated
Dim OneYearAgo As Date
OneYearAgo = DateAdd("yyyy", -1, ((Now)))
NotRecent_SQL = "SELECT IndexID, ATitle, AuditChecked FROM tblMain WHERE Not IsNull([AuditChecked]) AND (DateDiff(""yyyy"", CDate(AuditChecked), " & OneYearAgo & ") >= 1);"
[Edited by admin on 17-11-2017 at 12:32 PM GMT]