Zeit_ben_Std_LG.iqd 2.9 KB

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