In the following script I would like the BH_StartDate column to only return the highest date value as it presently returns all date values for all users. Is it possible to have only the Max date value with this script?
SELECT DISTINCT [dbo].[BH_Historic_Report_TaskAudit].BH_UserGuid AS 'BighandUserGUID',
BH_UserRole AS 'BighandUserRole',
[dbo].[BH_Users].BH_FirstName AS 'LastName',
[dbo].[BH_Users].BH_Lastname AS 'FirstName',
[dbo].[BH_Users].BH_UserName AS 'DisplayName',
BH_StartDate AS 'StartDate',
[dbo].[BH_Users].BH_Description AS 'JobDescription'
FROM [dbo].[BH_Historic_Report_TaskAudit]
JOIN [dbo].[BH_Users]
ON [dbo].[BH_Historic_Report_TaskAudit].BH_UserGuid = [dbo].[BH_Users].BH_UserGuid
WHERE BH_StartDate < '2015-04-29 00:00:00.000' AND BH_UserRole = 0 OR BH_UserRole = 2
ORDER BY [dbo].[BH_Users].BH_LastName
AND BH_UserRole IN ( 0, 2 )