I have 3 columns
DATE|END OF DAY BALANCE|ACCOUNT
I want to get the minimum balance where it is less than zero and the date or dates on which this happened.
The below query instead brings back all dates:
SELECT DISTINCT
END_OF_DAY_BALANCE.Date,
MIN(END_OF_DAY_BALANCE.[END OF DAY BALANCE]) AS [MinOfEND OF DAY BALANCE],
END_OF_DAY_BALANCE.[ACCOUNT]
FROM END_OF_DAY_BALANCE
GROUP BY END_OF_DAY_BALANCE.Date,
END_OF_DAY_BALANCE.[ACCOUNT]
HAVING(((MIN(END_OF_DAY_BALANCE.[END OF DAY BALANCE])) < 0));