Greetings,
I'm trying to write an SQL statement to give me records where a specific field's value hasn't existed in the last 90 days.
This field is for customer names, called PDC.
Each record also has a date field to let me know when the customer placed an order.
So far, I've tried using a subquery to find all of the PDC values over the last 90 days and use a NOT IN(SQL) in my parent queries WHERE clause. Something like this:
That SQL, as it is, tries to run for several minutes but doesn't produce a recordset. Any ideas to point me in the right direction? Thanks!
~Melagan
______
"It's never too late to become what you might have been.
I'm trying to write an SQL statement to give me records where a specific field's value hasn't existed in the last 90 days.
This field is for customer names, called PDC.
Each record also has a date field to let me know when the customer placed an order.
So far, I've tried using a subquery to find all of the PDC values over the last 90 days and use a NOT IN(SQL) in my parent queries WHERE clause. Something like this:
Code:
SELECT e.PDC
FROM Escrows as e
WHERE e.PDC Not In (SELECT e.PDC FROM Escrows as e WHERE DateDiff("d", [Opening Date], Date()) <=89)
GROUP BY e.PDC;
That SQL, as it is, tries to run for several minutes but doesn't produce a recordset. Any ideas to point me in the right direction? Thanks!
~Melagan
______
"It's never too late to become what you might have been.