Hi, hoping for some quick guidance on what should be a very easy SQL statement...
I would like to find all accounts in a table where there is more than one record in the table for that account where the end date is 0. Each account should only have one record in the table without an end date, so I'm trying to find those accounts that have more than one record with no end date.
where enddate = 0
group by account
having count(*) > 1
order by account
But this will also find accounts with more than one record as long as one of them has an enddate = 0, and I only want to see those where multiple records for that account have enddate = 0.
Any help would be appreciated... thanks!