database - Finding Lowest Start DateTime and Highest End DateTime in each group by only EntryDate and Emp_id in MS SQL Server -
i want find
- lowest "startdatetime"
- highest "enddatetime"
when i'm grouping data
- the date portion of "entrydate"(ignoring time portion)
- "empl_id" in ms sql server
my data looks this
what results should like
this ?
select emp_id, min (startdatetime), max (enddatetime) yourtable group emp_id, convert(date, entrydate)
Comments
Post a Comment