SELECT CLIENT.ID, MAX(MATTERS.DATE_OPENED), MIN(MATTERS.DATE_OPENED) FROM CLIENT INNER JOIN MATTERS ON CLIENT.ID = MATTERS.CLIENT_ID
I want to know if there are any matters that have a Date Opened between 19/01/09 and 19/01/10. I am having difficulty because the min and max dates might show dates outside this period, but may still contain a matter within the period. I need something like:
CASE WHEN MATTERS.DATE_OPENED >=19/01/10 AND MATTERS.DATE_OPENED <19/01/10 THEN 'Y' ELSE 'N' END
This isn't working because I have the group clause...