I'm afraid it's not quite that simple. I have multiple lines with the same ID, but when I return the values I only want distinct ID's returned and I want the system to choose the ID with the latest timestamp when there are multiple lines with the same ID. Any suggestions?