I am trying to select a list of patients who have a diabetes diagnosis code at any point in the past ~ 1 1/2 years and return either a 1 (patient does have a diabetes diagnosis code) or 0 (patient does not have a diabetes diagnosis code) into a hash table for later use. I am getting the 1's and 0's that I wanted, however for many patients I am returning both a 1 and a 0. I've tried troubleshooting as best I can, but haven't been able to return just a single value per patient. Here is the query I've been using. I am trying to select a list of patients who ha