Greetings,
I have an order table I'm trying to query to give me any new orders opened by people who havn't opened any orders in the last six months; by new orders, ofcourse, I mean orders whose [Opening Date] = Date().
Schema info:
Table name = Escrows
Fields:
[Escrow Number] - (Primary Key)
[Opening Date] - Date order opened
[PDC] - Person who opened the order
[PDC_Rep] - Sales person who gets credit for the order opened.
My thoughts were to create a subquery to show all of the people who HAVE opened in the last six months then run those results against my main query, like so:
I expect that any orders that have opened today that have not come from any specific customers from within the last six months, as defined by my subquery, would appear in this query. However, I am not getting the results I want with the above code. If this isn't enough info, I'll be happy to post some example data and expected results. Thank you!
~Melagan
______
"It's never too late to become what you might have been.
I have an order table I'm trying to query to give me any new orders opened by people who havn't opened any orders in the last six months; by new orders, ofcourse, I mean orders whose [Opening Date] = Date().
Schema info:
Table name = Escrows
Fields:
[Escrow Number] - (Primary Key)
[Opening Date] - Date order opened
[PDC] - Person who opened the order
[PDC_Rep] - Sales person who gets credit for the order opened.
My thoughts were to create a subquery to show all of the people who HAVE opened in the last six months then run those results against my main query, like so:
Code:
SELECT
e.[Escrow Number]
, e.PDC
, e.PDC_Rep
, e.[Opening Date]
FROM Escrows e
WHERE
e.PDC Not In (
SELECT PDC
FROM Escrows
WHERE PDC<>"" AND [Opening Date]>Date()-180
GROUP BY PDC
)
I expect that any orders that have opened today that have not come from any specific customers from within the last six months, as defined by my subquery, would appear in this query. However, I am not getting the results I want with the above code. If this isn't enough info, I'll be happy to post some example data and expected results. Thank you!
~Melagan
______
"It's never too late to become what you might have been.