Zeit_ben_Std_LG.iqd 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. COGNOS QUERY
  2. STRUCTURE,1,1
  3. DATABASE,Locosoft_GC
  4. DATASOURCENAME,C:\GlobalCube\System\LOCOSOFT\IQD\zeit\Zeit_ben_Std_LG.imr
  5. TITLE,Zeit_ben_Std_LG.imr
  6. BEGIN SQL
  7. select distinct c1 as c1,
  8. c2 as c2,
  9. c3 as c3,
  10. c4 as c4,
  11. c5 as c5,
  12. c6 as c6,
  13. c7 as c7,
  14. c8 as c8,
  15. c9 as c9,
  16. c10 as c10,
  17. c11 as c11,
  18. c12 as c12,
  19. c13 as c13,
  20. c14 as c14,
  21. c15 as c15,
  22. c16 as c16,
  23. c17 as c17,
  24. c18 as c18,
  25. c19 as c19,
  26. c20 as c20,
  27. c21 as c21,
  28. c22 as c22,
  29. c23 as c23,
  30. c24 as c24,
  31. XMIN(c15 for c1,c8) as c25
  32. from
  33. (select c31 as c1,
  34. '' as c2,
  35. '' as c3,
  36. '' as c4,
  37. c44 as c5,
  38. c43 as c6,
  39. 0 as c7,
  40. c30 as c8,
  41. 10 as c9,
  42. 'ben. Std.' as c10,
  43. '' as c11,
  44. c42 as c12,
  45. c41 as c13,
  46. c40 as c14,
  47. c39 as c15,
  48. c39 as c16,
  49. c38 as c17,
  50. c37 as c18,
  51. 0 as c19,
  52. c36 as c20,
  53. c35 as c21,
  54. c34 as c22,
  55. c33 as c23,
  56. c32 as c24,
  57. XMIN(c39 for c31,c30) as c26
  58. from
  59. (select T2."mechanic_no" as c30,
  60. T1."order_number" as c31,
  61. T5."end_time" as c32,
  62. T5."start_time" as c33,
  63. T4."cancelation_date" as c34,
  64. T4."cancelation_number" as c35,
  65. T4."is_canceled" as c36,
  66. (T5."exact_duration_seconds" / 60) / 60 as c37,
  67. T5."exact_duration_seconds" / 60 as c38,
  68. T4."invoice_date" as c39,
  69. (rtrim((cast_numberToString(cast_integer(T3."employee_number"))))) || ' - ' || T3."name" as c40,
  70. T3."name" as c41,
  71. T3."employee_number" as c42,
  72. '0' || (rtrim((cast_numberToString(cast_integer(T3."subsidiary"))))) as c43,
  73. T2."order_number" as c44
  74. from "LOCOSOFT"."dbo"."times" T5,
  75. ("dbo"."invoices" T4 left outer join (("dbo"."order_positions" T1 left outer join "dbo"."labours" T2 on T1."order_number" = T2."order_number") left outer join "dbo"."employees" T3 on T2."mechanic_no" = T3."employee_number") on (T2."invoice_number" = T4."invoice_number") and (T2."invoice_type" = T4."invoice_type"))
  76. where ((T2."order_number" = T5."order_number") and (T2."mechanic_no" = T5."employee_number"))
  77. and (((cast_float(T2."time_units"))) <> 0)
  78. ) D2
  79. ) D1
  80. where (c26 = c15)
  81. order by c1 asc,c8 asc,c23 asc
  82. END SQL
  83. COLUMN,0,Order Number
  84. COLUMN,1,Labour Type
  85. COLUMN,2,Code_Labour_Types
  86. COLUMN,3,Description_Labour_Types
  87. COLUMN,4,Order Number_Labours
  88. COLUMN,5,Subsidiary_Labours
  89. COLUMN,6,Invoice Type_Labours
  90. COLUMN,7,Mechanic No_Labours
  91. COLUMN,8,AW/Std.
  92. COLUMN,9,Zeitkategorie
  93. COLUMN,10,Zeitkategorie2
  94. COLUMN,11,Employee Number_Employee
  95. COLUMN,12,Name_Employee
  96. COLUMN,13,Monteur
  97. COLUMN,14,Invoice Date_Invoices
  98. COLUMN,15,Datum
  99. COLUMN,16,Duration Minutes_Times
  100. COLUMN,17,ben. Std.
  101. COLUMN,18,Invoice Number
  102. COLUMN,19,Is Canceled
  103. COLUMN,20,Cancelation Number
  104. COLUMN,21,Cancelation Date
  105. COLUMN,22,Start Time
  106. COLUMN,23,End Time
  107. COLUMN,24,Min_Invoice_Date