Zeit_Stempelungen_Pausen.iqd 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. COGNOS QUERY
  2. STRUCTURE,1,1
  3. DATABASE,Locosoft_GC
  4. DATASOURCENAME,C:\GlobalCube\System\LOCOSOFT\IQD\zeit\Zeit_Stempelungen_Pausen.imr
  5. TITLE,Zeit_Stempelungen_Pausen.imr
  6. BEGIN SQL
  7. select 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. c25 as c25,
  32. c26 as c26,
  33. c27 as c27,
  34. c28 as c28,
  35. c29 as c29,
  36. c30 as c30,
  37. c31 as c31,
  38. c32 as c32,
  39. c33 as c33,
  40. c34 as c34,
  41. c35 as c35,
  42. c36 as c36,
  43. c37 as c37,
  44. c38 as c38,
  45. c39 as c39,
  46. c40 as c40,
  47. c41 as c41,
  48. c42 as c42,
  49. c43 as c43,
  50. c44 as c44,
  51. c45 as c45,
  52. c46 as c46,
  53. c47 as c47,
  54. c48 as c48,
  55. c49 as c49,
  56. c50 as c50,
  57. XMAX(c50 for c1) as c51,
  58. c52 as c52,
  59. XMAX(c52 for c1) as c53,
  60. c54 as c54,
  61. c55 as c55
  62. from
  63. (select c61 as c1,
  64. c106 as c2,
  65. c105 as c3,
  66. c104 as c4,
  67. c103 as c5,
  68. c102 as c6,
  69. c101 as c7,
  70. c100 as c8,
  71. c99 as c9,
  72. c85 as c10,
  73. c92 as c11,
  74. c98 as c12,
  75. c97 as c13,
  76. c96 as c14,
  77. c95 as c15,
  78. c94 as c16,
  79. c93 as c17,
  80. c92 as c18,
  81. '1' as c19,
  82. c91 as c20,
  83. c90 as c21,
  84. c88 as c22,
  85. c89 as c23,
  86. c88 as c24,
  87. c87 as c25,
  88. '' as c26,
  89. c86 as c27,
  90. c85 as c28,
  91. c84 as c29,
  92. c83 as c30,
  93. c82 as c31,
  94. c81 as c32,
  95. c80 as c33,
  96. c79 as c34,
  97. c78 as c35,
  98. c69 as c36,
  99. c77 as c37,
  100. c76 as c38,
  101. c75 as c39,
  102. c74 as c40,
  103. c73 as c41,
  104. c72 as c42,
  105. c71 as c43,
  106. c70 as c44,
  107. c69 as c45,
  108. c68 as c46,
  109. c67 as c47,
  110. c66 as c48,
  111. c65 as c49,
  112. c64 as c50,
  113. c63 as c52,
  114. c62 as c54,
  115. c62 as c55,
  116. XMAX(c64 for c61) as c56,
  117. XMAX(c63 for c61) as c57
  118. from
  119. (select T1."employee_number" as c61,
  120. (CASE WHEN ((CASE WHEN (T3."type" = 1) THEN (T2."duration_minutes" / 60) ELSE (0) END) >= 6.1) THEN ((T4."break_end" - T4."break_start") * -1) ELSE (0) END) as c62,
  121. T4."validity_date" as c63,
  122. T5."validity_date" as c64,
  123. T5."worktime_end" as c65,
  124. T5."worktime_start" as c66,
  125. T5."work_duration" as c67,
  126. T5."dayofweek" as c68,
  127. T4."break_end" - T4."break_start" as c69,
  128. ((od_hour(T2."end_time"))) + (((od_minute(T2."end_time"))) / 60) as c70,
  129. ((od_minute(T2."end_time"))) / 60 as c71,
  130. ((od_hour(T2."start_time"))) + (((od_minute(T2."start_time"))) / 60) as c72,
  131. ((od_minute(T2."start_time"))) / 60 as c73,
  132. (od_minute(T2."end_time")) as c74,
  133. (od_hour(T2."end_time")) as c75,
  134. (od_minute(T2."start_time")) as c76,
  135. (od_hour(T2."start_time")) as c77,
  136. T4."break_end" as c78,
  137. T4."break_start" as c79,
  138. T4."dayofweek" as c80,
  139. T4."is_latest_record" as c81,
  140. T1."break_time_registration" as c82,
  141. T1."is_flextime" as c83,
  142. (dayofweek(T2."start_time")) as c84,
  143. T2."order_number" as c85,
  144. T2."duration_minutes" / 60 as c86,
  145. CASE WHEN (T2."type" = 2) THEN ('produktiv') ELSE ('unproduktiv') END as c87,
  146. CASE WHEN (T3."type" = 1) THEN (T2."duration_minutes" / 60) ELSE (0) END as c88,
  147. CASE WHEN (T3."type" = 2) THEN (T2."duration_minutes" / 60) ELSE (0) END as c89,
  148. (rtrim((cast_numberToString(cast_integer(T1."employee_number"))))) || ' - ' || T1."name" as c90,
  149. '0' || (rtrim((cast_numberToString(cast_integer(T1."subsidiary"))))) as c91,
  150. T2."start_time" as c92,
  151. T3."description" as c93,
  152. T3."type" as c94,
  153. T2."duration_minutes" as c95,
  154. T2."end_time" as c96,
  155. T2."order_positions" as c97,
  156. T2."type" as c98,
  157. T2."employee_number" as c99,
  158. T1."leave_date" as c100,
  159. T1."termination_date" as c101,
  160. T1."employment_date" as c102,
  161. T1."salesman_number" as c103,
  162. T1."mechanic_number" as c104,
  163. T1."initials" as c105,
  164. T1."name" as c106
  165. from "dbo"."employees" T1,
  166. "LOCOSOFT"."dbo"."employees_breaktimes" T4,
  167. "LOCOSOFT"."dbo"."employees_worktimes" T5,
  168. ("dbo"."times" T2 left outer join "dbo"."time_types" T3 on T2."type" = T3."type")
  169. where (T1."employee_number" = T2."employee_number") and (T1."employee_number" = T4."employee_number") and (T1."employee_number" = T5."employee_number")
  170. and ((((T2."type" = 1) and (((dayofweek(T2."start_time"))) = T4."dayofweek")) and (((dayofweek(T2."start_time"))) = T5."dayofweek")) and (T2."start_time" >= TIMESTAMP '2017-01-01 00:00:00.000'))
  171. ) D2
  172. ) D1
  173. where ((c50 = c56) and (c52 = c57))
  174. order by c1 asc,c11 asc,c10 asc
  175. END SQL
  176. COLUMN,0,Employee Number_Employees
  177. COLUMN,1,Name_Employees
  178. COLUMN,2,Initials_Employees
  179. COLUMN,3,Mechanic Number_Employees
  180. COLUMN,4,Salesman Number_Employees
  181. COLUMN,5,Employment Date_Employees
  182. COLUMN,6,Termination Date_Employees
  183. COLUMN,7,Leave Date_Employees
  184. COLUMN,8,Employee Number_Times
  185. COLUMN,9,Order Number_Times
  186. COLUMN,10,Start Time_Times
  187. COLUMN,11,Type_Times
  188. COLUMN,12,Order Positions_Times
  189. COLUMN,13,End Time_Times
  190. COLUMN,14,Duration Minutes_Times
  191. COLUMN,15,Type_Time_Types
  192. COLUMN,16,Description_Time_Types
  193. COLUMN,17,Datum
  194. COLUMN,18,Hauptbetrieb
  195. COLUMN,19,Standort
  196. COLUMN,20,Monteur
  197. COLUMN,21,Anwesenheit_
  198. COLUMN,22,produktiv_
  199. COLUMN,23,unproduktiv_
  200. COLUMN,24,Zeitkategorie
  201. COLUMN,25,Zeitkategorie2
  202. COLUMN,26,Ges. Std._
  203. COLUMN,27,Order Number
  204. COLUMN,28,Wochentag_Datum
  205. COLUMN,29,Is Flextime_Employees
  206. COLUMN,30,Break Time Registration_Employees
  207. COLUMN,31,Is Latest Record_break_times
  208. COLUMN,32,Dayofweek_break_times
  209. COLUMN,33,Break Start_break_times
  210. COLUMN,34,Break End_break_times
  211. COLUMN,35,Pause
  212. COLUMN,36,Start_Times_Stunde
  213. COLUMN,37,Start_Times_Minute
  214. COLUMN,38,End_Times_Stunde
  215. COLUMN,39,End_Times_Minute
  216. COLUMN,40,Start_Times_Minute_Dezimal
  217. COLUMN,41,Start_Times_Dezimal
  218. COLUMN,42,End_Times_Minute_Dezimal
  219. COLUMN,43,End_Times_Dezimal
  220. COLUMN,44,Pausenzeit_Stunde
  221. COLUMN,45,Dayofweek_Worktimes
  222. COLUMN,46,Work Duration_Worktimes
  223. COLUMN,47,Worktime Start_Worktimes
  224. COLUMN,48,Worktime End_Worktimes
  225. COLUMN,49,Validity Date_Worktimes
  226. COLUMN,50,Max_Validity_Date
  227. COLUMN,51,Validity Date_Break_times
  228. COLUMN,52,Max_validity_date_Break_times
  229. COLUMN,53,Pausenzeit_Anw_mehr_als_6
  230. COLUMN,54,Anwesenheit