I'm having a problem with getting the data I need from the query below. Basically, I'm looking at changes that were made to a set of records, and trying to use the change log to revert back to the original value for my report. The problem is, the query is not pulling the "right" row from the audit log.Here's the query:SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED Select TSK.TaskID AS 'task_id', AUD.TaskAuditID AS 'task_audit_id', RTE.Description AS 'route_to', RT2.Description AS 'route_to_orig', TYP.Description AS 'TaskType', SUB.Description AS 'SubTaskType', STA.Description AS 'StatusID', CUS.CustID AS 'CustID', CONVERT(char(10), TSK.CreatedDate, 126) AS 'CreatedDate', CONVERT(char(10), TSK.ClosedDate, 126) as 'ClosedDate', Case When Cus.CustomerCountry in ('USA', 'US') THEN 'US' When Cus.CustomerCountry = 'CA' Then 'Canada' Else 'Other' End as 'Country', CUS.ACNSystemOwner As 'System', CUS.Serviceclass AS 'SvcClass'FROM ACN_Extensions.dbo.ACN_CCPCaseManagementTask TSK left outer join ACN_Extensions.dbo.ACN_CCPCaseManagementRoute RTE on TSK.RouteID = RTE.RouteID left outer join ACN_Extensions.dbo.ACN_CCPCaseManagementTaskAudit AUD on AUD.TaskID = TSK.TaskID and AUD.ColumnName = 'RouteID' left outer join ACN_Extensions.dbo.ACN_CCPCaseManagementRoute RT2 on AUD.OriginalValue = RT2.RouteID, ACN_Extensions.dbo.ACN_CCPCaseManagementTaskType TYP, ACN_Extensions.dbo.ACN_CCPCaseManagementSubTaskType SUB, ACN_Extensions.dbo.ACNCustomer CUS, ACN_Extensions.dbo.ACN_CCPCaseManagementStatus STA WHERE TSK.CreatedDate >= DateAdd(dd,DateDiff(dd,0,getdate()-7),0) and TSK.CreatedDate < DateAdd(dd,DateDiff(dd,0,getdate()),0) and (TSK.CreatedBy <> TSK.ClosedBy OR TSK.ClosedBy IS NULL) and TSK.TaskTypeID = TYP.TaskTypeID and TSK.SubTaskTypeID =SUB.SubTaskTypeID and TSK.CustID=Cus.CustID and TSK.StatusID = STA.StatusIDORDER BY TSK.TaskIDExcerpt of results includes:task_id, task_audit_id, route_to, route_to_orig5973661, 4712577, Customer Care - CSA, Customer Care - Tier 2 Support5973661, 4729011, Customer Care - CSA, Customer Care - Research5973661, 4731482, Customer Care - CSA, Customer Care - SupervisorI want to get this to only one row of the task_id and the task_audit_id that is the smallest number. I've tried adding DISTINCT to the query, but it just grabs any old task_audit_id, not the one I want. I'm at a total loss on this one...task_id, task_audit_id, route_to, route_to_orig5973661, 4712577, Customer Care - CSA, Customer Care - Tier 2 SupportPlease help.