Select the first log in Time using from Table using SQL Server 2008 R2 -
i have table of employees describe last , first name, card id , times log in enterprise. want select first time logs in.
thise example of table
and result want this result want
you group last name, first name , truncated date , return minimal date per group. in modern sql server versions truncation pretty simple - cast field_time
date
:
select last_name, first_name, cast(field_time date) log_day, min(field_time) first_log mytable group last_name, first_name, cast(field_time date)
Comments
Post a Comment