Skip to content

Find start date and end date from the employee time clock

I am trying to find out star date and end date for the employee time clock. Following is the example of the data I have. Output wanted: I have to find the start date and end date of the person based on eventtime and activitycode. The start date will be event time column and I have to calculate end date

Finding an ID not in another column

I’m working on a little SQL exercise, and am scratching my head an this problem. I am trying to find all the Employees to whom no other employee reports to. This is what the employees table looks …

Row lumping, cycle dates

I want to look at the lead type and if that type is the same for that row then merge in those dates to fit within one row. I have the below table: Expected Results: How can I get my output to look like the expected results? I have tested withlead lag rank and case expression but nothing worthy of

SQL to pivot a field with CASE WHEN

My table has fields: Item, AttributeNo_, AttrbuteValue. Each AttributeNo_ has a matched AttributeName. e.g. Item, AttributeNo_, AttributeValue A, 1, Yellow A, 2, Round …… …

Stuck on final SQL query

I’m busy creating a report and am stuck with how to structure the final query. I have a sub-query that returns the following result set I need the final query result to look like this: I know I can …