I have a table that contains information regarding what they've done throughout the day. I need to get the start time/end time for each task.
Currently I am able to pull the timestamp of each task, but I am hoping to create Start Times and End Times columns. Start time would be the timestamp from the previous row, and end time would be the timestamp from the current row.
Is there any simple way to do this? Here is the query that I am currently using.
select
Timestamp,
Sku,
Station,
Username,
ActionType
from OverallLogs
where
and ActionType = 'Put'
and Username = 'Name'
and timestamp < DateAdd(Day, DateDiff(Day, 0, GetDate())+1, 0)
AND timestamp >= DateAdd(Day, DateDiff(Day, 0, GetDate()), 0)
Order by timestamp desc