this is my sql query -> select convert (varchar,Log_Date,23)[date],Agent_Name,
min (case when state = ‘Login’ then Log_Date end ) [First Login],
dateadd(hour,9, min (case when state = ‘Login’ then Log_Date end )) [First Login + 9 Hour Shit],
max (Log_Date) [Log out]
from AMS_Log where Agent_Name IS NOT NULL and Log_Date is not null
group by convert (varchar,Log_Date,23),Agent_Name
order by Agent_Name
Please help to get those records between [First Login + 9 Hour Shit] and [Log out] with group by date and agent name
pintu yadav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1