Hi,

Iave this SQL that should return recors with MAX(DateTimeCreated). DB has 2 records 1 with 01/31/08 and 1 with 01/18/2008. My SQL is returning 01/18/2008; I do not know why? Can someone guide me please? Thanks

select ejhcoid,ejheeid,
max(ejhdatetimecreated) as maxdatetimecreated
from ULTIPRO_FREE.dbo.EmpHJob
where
EjhEmplStatus <> 'T' and
ejhdatetimecreated between '2008/01/01' and '2008/01/31'and
ejhisratechange = 'Y' and
ejheeid = '5U8FX30000K0'
group by ejhcoid,ejheeid