Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT ISNULL(NULLIF(CONCAT(e.FirstName, ' ', e.LastName) , ' '), 'None') AS Employee,
- ISNULL(d.[Name], 'None') AS Department,
- c.[Name] AS Category,
- r.[Description],
- FORMAT(r.OpenDate, 'dd.MM.yyyy') AS OpenDate,
- s.[Label],
- u.[Name]
- FROM Reports AS r
- LEFT JOIN Employees AS e ON e.Id = r.EmployeeId
- LEFT JOIN Departments AS d ON d.Id = e.DepartmentId
- JOIN Categories AS c ON c.Id = r.CategoryId
- JOIN [Status] AS s ON s.Id = r.StatusId
- JOIN Users AS u ON u.Id = r.UserId
- ORDER BY e.FirstName DESC, e.LastName DESC, Department, Category, r.[Description], r.OpenDate, s.[Label], u.[Name]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement