Puoi utilizzare la seguente query:
SELECT ID, brandname, cdt, udt, brandstatus, addedby
FROM (
SELECT ID, brandname, cdt, udt, brandstatus, addedby,
ROW_NUMBER() OVER (PARTITION BY brandname,
CAST(udt AS DATE),
CONVERT(VARCHAR(5), udt, 114)
ORDER BY udt DESC) AS rn
FROM brands) AS t
WHERE t.rn = 1
Questa parte:
CONVERT(VARCHAR(5), udt, 114)
viene utilizzato per estrarre ore e minuti da udt
campo.