Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. CREATE VIEW dbo.ALCActivitiesView
  2. AS
  3. SELECT
  4. tasks.TaskID,
  5. tasks.HierarchyElementId AS DMA,
  6. 'LONG NAME' AS DMALongName,
  7. 'DZ Short Name' AS DZ,
  8. 'DZ Long Name' AS DZLongName,
  9. 'NMA Short Name' AS NMA,
  10. 'NMA Long Name' AS NMALongName,
  11. 'OA Short Name' AS OA,
  12. 'OA Long Name' AS OALongName,
  13. 'John' AS TechnicianName,
  14. 'Smith' AS TechnicianSurname,
  15. 'ACT-06' AS ActivityCode,
  16. 'Full Sweep' AS ActivityDescription,
  17. CASE WHEN tasks.IsCompleted = 1 THEN 1 ELSE NULL END AS EligibleReason, -- (Enum)
  18. CASE WHEN tasks.IsCompleted = 1 THEN GETDATE() ELSE NULL END AS DateMadeEligible,
  19. tasks.StartDate as StartDate,
  20. tasks.EndDate as EndDate,
  21. tasks.IsCompleted as IsCompleted,
  22. tasks.IsPackDeployed as IsPackDeployed,
  23. tasks.ActualDuration as HoursWorked,
  24. 10 as LoggersDeployed,
  25. 20 as LoggersInAlarm,
  26. 30 as PointsOfInterest,
  27. 40 as BMsFound,
  28. 50 as OthersFound
  29. FROM ActiveLeakageControlTasks AS tasks
  30. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement