I'm currently working on a query which is being used to return records which are overdue, based on the calculation of:
In order to show these overdue records, my WHERE clause looks like this:
Here is my problem: I would like to display only records that have their InspRequiredOn < Date() OR where InspRequiredOn Is Null - but for either case, the record must also have PropInspBegun = -1 (PropInspBegun is a yes/no box).
Anyone have an idea of how to make this work? Below is the SQL in its current form:
Code:
((([InspRequiredOn]+(([PropInspInterval]*365)+1))<(Date())))
Code:
WHERE ((([InspRequiredOn]+(([PropInspInterval]*365)+1))<(Date()))) And ((([tblProperty.PropInspBegun])=-1) And (([tblInspection].[InspRequiredOn]) Is Null))
Anyone have an idea of how to make this work? Below is the SQL in its current form:
Code:
SELECT [tblOwner].[OwnersBusiness], [InspRequiredOn]+(([PropInspInterval]*365)+1) AS Expr1, [tblOwner].[AutoIDOwner], [tblOwner].[SiteAccepted], [tblOwner].[OwnersFirstName], [tblOwner].[OwnersLastName], [tblOwner].[OwnersStreetAdd], [tblOwner].[OwnersCity], [tblOwner].[OwnersState], [tblOwner].[OwnersZipCode], [tblOwner].[OwnersPhoneNumber], [tblOwner].[OwnersEmail], [tblOwner].[MntAgrSigned], [tblOwner].[MntAgrDate], [tblOwner].[MntAgrLoc], [tblOwner].[OwnerNotes], [tblProperty].[PropInspBegun]
FROM (tblOwner INNER JOIN tblProperty ON [tblOwner].[AutoIDOwner]=[tblProperty].[AutoIDOwner]) INNER JOIN tblInspection ON [tblProperty].[AutoIDProperty]=[tblInspection].[AutoIDProperty]
WHERE ((([InspRequiredOn]+(([PropInspInterval]*365)+1))<(Date()))) And ((([tblProperty.PropInspBegun])=-1) And (([tblInspection].[InspRequiredOn]) Is Null))
ORDER BY [InspRequiredOn]+(([PropInspInterval]*365)+1);