Prepare for your Next Interview
This is a discussion on MAX(Date) Function SQL Server within the SQL forums, part of the Databases category; 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 ...
|
|||
|
MAX(Date) Function SQL Server
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 |
| Sponsored Links |
|
|||
|
Re: MAX(Date) Function SQL Server
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 Problem may be with ejhisratechange. Both the records may not satisfy this codition. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Function in datastage to find date after 6 months | Geek_Guest | Database General | 4 | 09-22-2008 03:17 PM |
| Adding storage function to a mail server | satimis | Database General | 0 | 01-04-2008 03:54 AM |
| romise date, Need by date, Original Date in PO | Geek_Guest | Oracle Apps | 0 | 04-07-2007 12:53 AM |
| Date Function in Oracle | Robert | Oracle | 4 | 02-16-2007 06:15 AM |
| SQL Server Replace Function | suji | SQL Server | 1 | 01-30-2007 12:54 PM |