Hi There, I'm new to SAS, using SAS Enterprise Guide 7.12 and running this code. I can't seem to get a distinct list based on the dttm_create. I tried using group by and having, sub-query and all other different variations but nothing seem to work. The SQL runs fine (no sql error) but just not returning the correct results. Can someone please help? I've been at this for 2 days now Thank you so much in advance! PROC SQL; CREATE TABLE WORK.TABLE2 AS SELECT DISTINCT ID1, ID2, CYCLE_DATE, AMT, STATUS, MAX(DTTM_CREATE) FORMAT=DATETIME25.6 AS MAX_of_DTTM_CREATE FROM WORK.TABLE1 WHERE ID1 = '123456789' GROUP BY ID1, ID2, CYCLE_DATE, AMT, STATUS, DTTM_CREATE; QUIT; This is the result I'm getting but the SQL should only give me the first row. ID1 ID2 CYCLE_DATE AMOUNT STATUS MAX_of_DTTM_CREATE 123456789 987654321 31-Dec-19 1.67 Active 03JAN2020:03:04:35.353335 123456789 987654321 31-Dec-19 2.01 Active 06DEC2019:02:48:35.810525
... View more