123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970 |
- COGNOS QUERY
- STRUCTURE,1,1
- DATABASE,O21
- DATASOURCENAME,C:\GAPS\Portal\System\IQD\NW\NW_BE_Einsatz.imr
- TITLE,NW_BE_Einsatz.imr
- BEGIN SQL
- select c1 as c1,
- c2 as c2,
- c3 as c3,
- c4 as c4,
- c5 as c5,
- c6 as c6,
- c7 as c7,
- c8 as c8,
- c9 as c9,
- c10 as c10,
- c11 as c11,
- c12 as c12,
- c13 as c13,
- c14 as c14,
- c15 as c15,
- c16 as c16,
- c17 as c17,
- c18 as c18,
- c19 as c19,
- c20 as c20,
- c21 as c21,
- c22 as c22,
- c23 as c23,
- c24 as c24,
- c25 as c25,
- c26 as c26,
- c27 as c27,
- c28 as c28,
- c29 as c29,
- c30 as c30,
- c31 as c31,
- c32 as c32,
- c33 as c33,
- c34 as c34,
- c35 as c35,
- c36 as c36,
- c37 as c37,
- c38 as c38,
- c39 as c39,
- c40 as c40,
- c41 as c41,
- c42 as c42,
- c43 as c43,
- c44 as c44,
- c45 as c45,
- c46 as c46,
- c47 as c47,
- c48 as c48,
- c49 as c49,
- c50 as c50,
- c51 as c51,
- c52 as c52,
- c53 as c53,
- c54 as c54,
- c55 as c55,
- c56 as c56,
- c57 as c57,
- c58 as c58,
- c59 as c59,
- c60 as c60,
- c61 as c61,
- c62 as c62,
- c63 as c63,
- c64 as c64,
- c65 as c65,
- c66 as c66,
- c67 as c67,
- c68 as c68,
- c69 as c69,
- c70 as c70,
- c71 as c71,
- c72 as c72,
- c73 as c73,
- c74 as c74,
- c75 as c75,
- c76 as c76,
- c77 as c77,
- c78 as c78,
- c79 as c79,
- c80 as c80,
- c81 as c81,
- c82 as c82,
- c83 as c83,
- c84 as c84,
- c85 as c85,
- c86 as c86,
- c87 as c87,
- c88 as c88,
- c89 as c89,
- c90 as c90,
- c91 as c91,
- c92 as c92,
- c93 as c93,
- c94 as c94,
- c95 as c95,
- c96 as c96,
- c97 as c97,
- c98 as c98,
- c99 as c99,
- c100 as c100,
- c101 as c101,
- c102 as c102,
- c103 as c103,
- c104 as c104,
- c105 as c105,
- c106 as c106,
- c107 as c107,
- c108 as c108,
- c109 as c109,
- c110 as c110,
- c111 as c111,
- c112 as c112,
- c113 as c113,
- c114 as c114,
- c115 as c115,
- c116 as c116,
- c117 as c117,
- c118 as c118,
- c119 as c119,
- c120 as c120,
- c121 as c121,
- c122 as c122,
- c123 as c123,
- c124 as c124,
- c125 as c125,
- c126 as c126,
- c127 as c127,
- c128 as c128,
- c129 as c129,
- c130 as c130,
- c131 as c131,
- c132 as c132,
- c133 as c133,
- c134 as c134,
- c135 as c135,
- c136 as c136,
- c137 as c137,
- c138 as c138,
- c139 as c139,
- c140 as c140,
- c141 as c141,
- c142 as c142,
- c143 as c143,
- c144 as c144,
- c145 as c145,
- c146 as c146,
- c147 as c147,
- c148 as c148,
- c149 as c149,
- c150 as c150,
- c151 as c151,
- c152 as c152,
- c153 as c153,
- c154 as c154,
- c155 as c155,
- c156 as c156,
- c157 as c157,
- c158 as c158,
- c159 as c159,
- c160 as c160,
- c161 as c161,
- c162 as c162,
- c163 as c163,
- c164 as c164,
- c165 as c165,
- c166 as c166,
- c167 as c167,
- c168 as c168,
- c169 as c169,
- c170 as c170,
- c171 as c171,
- c172 as c172,
- c173 as c173,
- c174 as c174,
- c175 as c175,
- c176 as c176,
- c177 as c177,
- c178 as c178,
- c179 as c179,
- c180 as c180,
- c181 as c181,
- c182 as c182,
- c183 as c183,
- c184 as c184,
- c185 as c185,
- c186 as c186,
- c187 as c187,
- c188 as c188,
- c189 as c189,
- c190 as c190,
- c191 as c191,
- c192 as c192,
- c193 as c193,
- c194 as c194,
- c195 as c195,
- c196 as c196,
- c197 as c197,
- c198 as c198,
- c199 as c199,
- c200 as c200,
- c201 as c201,
- c202 as c202,
- c203 as c203,
- c204 as c204,
- c205 as c205,
- c206 as c206,
- c207 as c207,
- c208 as c208,
- c209 as c209,
- c210 as c210,
- c211 as c211,
- c212 as c212,
- c213 as c213,
- c214 as c214,
- c215 as c215,
- c216 as c216,
- c217 as c217,
- c218 as c218,
- c219 as c219,
- c220 as c220,
- c221 as c221,
- c222 as c222,
- c223 as c223,
- c224 as c224,
- c225 as c225,
- c226 as c226,
- c227 as c227,
- c228 as c228,
- c229 as c229,
- c230 as c230,
- c231 as c231,
- c232 as c232,
- c233 as c233,
- c234 as c234,
- XMAX(c234 for c1) as c235,
- c236 as c236,
- c237 as c237,
- c238 as c238,
- c239 as c239,
- c240 as c240,
- c241 as c241
- from
- (select c245 as c1,
- c474 as c2,
- c473 as c3,
- c472 as c4,
- c471 as c5,
- c470 as c6,
- c469 as c7,
- c468 as c8,
- c467 as c9,
- c466 as c10,
- c465 as c11,
- c464 as c12,
- c463 as c13,
- c462 as c14,
- c461 as c15,
- c460 as c16,
- c459 as c17,
- c458 as c18,
- c457 as c19,
- c456 as c20,
- c455 as c21,
- c454 as c22,
- c453 as c23,
- c452 as c24,
- c451 as c25,
- c450 as c26,
- c449 as c27,
- c448 as c28,
- c447 as c29,
- c446 as c30,
- c445 as c31,
- c444 as c32,
- c443 as c33,
- c255 as c34,
- c442 as c35,
- c441 as c36,
- c440 as c37,
- c257 as c38,
- c439 as c39,
- c438 as c40,
- c437 as c41,
- c436 as c42,
- c435 as c43,
- c434 as c44,
- c433 as c45,
- c432 as c46,
- c431 as c47,
- c430 as c48,
- c429 as c49,
- c428 as c50,
- c427 as c51,
- c426 as c52,
- c425 as c53,
- c424 as c54,
- c423 as c55,
- c422 as c56,
- c421 as c57,
- c420 as c58,
- c419 as c59,
- c418 as c60,
- c417 as c61,
- c416 as c62,
- c415 as c63,
- c414 as c64,
- c413 as c65,
- c412 as c66,
- c411 as c67,
- c410 as c68,
- c260 as c69,
- c409 as c70,
- c408 as c71,
- c407 as c72,
- c406 as c73,
- c405 as c74,
- c404 as c75,
- c403 as c76,
- c402 as c77,
- c401 as c78,
- c400 as c79,
- c399 as c80,
- c398 as c81,
- c397 as c82,
- c396 as c83,
- c395 as c84,
- c394 as c85,
- c393 as c86,
- c392 as c87,
- c391 as c88,
- c390 as c89,
- c389 as c90,
- c388 as c91,
- c387 as c92,
- c386 as c93,
- c385 as c94,
- c384 as c95,
- c383 as c96,
- c382 as c97,
- c381 as c98,
- c380 as c99,
- c379 as c100,
- c378 as c101,
- c377 as c102,
- c376 as c103,
- c375 as c104,
- c374 as c105,
- c373 as c106,
- c372 as c107,
- c371 as c108,
- c370 as c109,
- c369 as c110,
- c368 as c111,
- c367 as c112,
- c366 as c113,
- c365 as c114,
- c364 as c115,
- c273 as c116,
- c363 as c117,
- c362 as c118,
- c361 as c119,
- c360 as c120,
- c359 as c121,
- c358 as c122,
- c357 as c123,
- c356 as c124,
- c355 as c125,
- c354 as c126,
- c274 as c127,
- c353 as c128,
- c352 as c129,
- c351 as c130,
- c350 as c131,
- c349 as c132,
- c348 as c133,
- c347 as c134,
- c346 as c135,
- c345 as c136,
- c344 as c137,
- c343 as c138,
- c342 as c139,
- c341 as c140,
- c340 as c141,
- c339 as c142,
- c338 as c143,
- c337 as c144,
- c336 as c145,
- c335 as c146,
- c334 as c147,
- c333 as c148,
- c332 as c149,
- c331 as c150,
- c330 as c151,
- c329 as c152,
- c328 as c153,
- c327 as c154,
- c326 as c155,
- c325 as c156,
- c324 as c157,
- c323 as c158,
- c322 as c159,
- c321 as c160,
- c320 as c161,
- c319 as c162,
- c318 as c163,
- c317 as c164,
- c316 as c165,
- c315 as c166,
- c314 as c167,
- c313 as c168,
- c312 as c169,
- c311 as c170,
- c310 as c171,
- c309 as c172,
- c308 as c173,
- c307 as c174,
- c306 as c175,
- c305 as c176,
- c304 as c177,
- c303 as c178,
- c302 as c179,
- c301 as c180,
- c300 as c181,
- c299 as c182,
- c298 as c183,
- c297 as c184,
- c296 as c185,
- c295 as c186,
- c294 as c187,
- c293 as c188,
- c292 as c189,
- c291 as c190,
- c290 as c191,
- c289 as c192,
- c288 as c193,
- c275 as c194,
- c287 as c195,
- c286 as c196,
- c285 as c197,
- c284 as c198,
- c283 as c199,
- c282 as c200,
- c281 as c201,
- c280 as c202,
- '1' as c203,
- c279 as c204,
- c278 as c205,
- c277 as c206,
- c276 as c207,
- c268 as c208,
- c275 as c209,
- c274 as c210,
- c273 as c211,
- c272 as c212,
- c271 as c213,
- c270 as c214,
- c269 as c215,
- c268 as c216,
- c267 as c217,
- 1 as c218,
- c266 as c219,
- c265 as c220,
- c264 as c221,
- c263 as c222,
- c262 as c223,
- c261 as c224,
- c260 as c225,
- c259 as c226,
- c258 as c227,
- c258 as c228,
- c257 as c229,
- c256 as c230,
- c255 as c231,
- c254 as c232,
- c253 as c233,
- c252 as c234,
- c251 as c236,
- c250 as c237,
- c249 as c238,
- c248 as c239,
- c247 as c240,
- c246 as c241,
- XMAX(c252 for c245) as c242
- from
- (select T1."UNIT_NUMBER" as c245,
- T9."REFERENCE" as c246,
- T9."ORDERS_GROSSVALUE" as c247,
- T9."COSTS" as c248,
- T9."TRANSACTION_CODE" as c249,
- (database()) as c250,
- CASE WHEN ((od_left(T7."DEPARTMENT_TYPE_ID",2)) = '01') THEN ('Brunsbüttel') WHEN ((od_left(T7."DEPARTMENT_TYPE_ID",2)) = '02') THEN ('Marne') WHEN ((od_left(T7."DEPARTMENT_TYPE_ID",2)) = '03') THEN ('Büsum') WHEN ((od_left(T7."DEPARTMENT_TYPE_ID",2)) = '04') THEN ('Meldorf') ELSE ('KST EK fehlt') END as c251,
- T6."UNIQUE_IDENT" as c252,
- T6."DEPARTMENT" as c253,
- CASE WHEN (T8."DESCRIPTION" IN ('Chevrolet','Chevrolet US Car','Opel')) THEN (T8."DESCRIPTION") ELSE ('Fremdfabrikat') END as c254,
- T1."BUD_SALE_DET" as c255,
- CASE WHEN (T9."TRANSACTION_CODE" IN ('47 ','40 ','41 ','49 ')) THEN (T9."ORDERS_GROSSVALUE") ELSE null END as c256,
- T1."BUD_COST" as c257,
- T10."SEL_NAME" as c258,
- T10."SELLER_CODE" as c259,
- (T1."LOCATION_CODE") as c260,
- (CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END) * 15 as c261,
- CASE WHEN (T3."CAR_LETTER" = 'Konsi') THEN ('Konsi-FZG') ELSE ('Lagerfahrzeug') END as c262,
- T3."CAR_LETTER" as c263,
- CASE WHEN ((CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END) BETWEEN 0 AND 30) THEN ('0 - 30 Tage') WHEN ((CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END) BETWEEN 31 AND 60) THEN ('31 - 60 Tage') WHEN ((CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END) BETWEEN 61 AND 90) THEN ('61 - 90 Tage') WHEN ((CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END) BETWEEN 91 AND 180) THEN ('91 - 180 Tage') WHEN ((CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END) > 180) THEN ('> 180 Tage') ELSE null END as c264,
- CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END as c265,
- (now()) as c266,
- CASE WHEN (T9."TRANSACTION_CODE" IN ('25 ','40 ')) THEN (T9."ORDERS_GROSSVALUE") ELSE null END as c267,
- T8."DESCRIPTION" as c268,
- T8."GLOBAL_MAKE_CD" as c269,
- CASE WHEN (T2."VEHICLE_TYPE" IS NULL) THEN (T1."VEHICLE_TYPE") ELSE (T2."VEHICLE_TYPE" || ' - ' || T2."VEHICLE_TYPE_TEXT") END as c270,
- T1."UNIT_NUMBER" || ' - ' || T3."CHASSIS_NUMBER" as c271,
- T3."COLOUR_CODE" || ' - ' || T3."COLOUR_CF" as c272,
- T3."CHASSIS_NUMBER" as c273,
- T3."MODEL_TEXT" as c274,
- T4."MOD_LIN_SPECIFY" as c275,
- CASE WHEN (T2."VEHICLE_TYPE" IN ('K','M','N','T','V')) THEN ('Neuwagen') WHEN (T2."VEHICLE_TYPE" IN ('R','D')) THEN ('Gebrauchtwagen') WHEN (T2."VEHICLE_TYPE" IN ('G')) THEN ('Geschäftswagen') ELSE null END as c276,
- T7."DESCRIPTION" as c277,
- T7."DEPARTMENT_TYPE_ID" as c278,
- CASE WHEN (T6."DEPARTMENT" IS NULL) THEN ((od_left(T7."DEPARTMENT_TYPE_ID",2))) ELSE ((od_left(T6."DEPARTMENT",2))) END as c279,
- T5."MAKE_CODE" as c280,
- T5."MODEL_GROUP" as c281,
- T5."MODEL_TYPE" as c282,
- T5."ORIG_MODEL_CODE" as c283,
- T5."MODEL_TEXT" as c284,
- T5."MAKE_CD" as c285,
- T5."WORKSHOP_MODEL" as c286,
- T4."MAKE_CD" as c287,
- T4."MODEL_LINE" as c288,
- T3."MAKE_CD" as c289,
- T3."SOLDMARK_DATE" as c290,
- T3."DISCOUNT_PERC_WORK" as c291,
- T3."WORKSHOP_PRICECODE" as c292,
- T3."HOURLY_REPAIR_RATE" as c293,
- T3."SERVICE_DAYS" as c294,
- T3."FUELTYPE" as c295,
- T3."DEALER_MARKING" as c296,
- T3."DEALER_NUMBER" as c297,
- T3."PURCH_AMOUNT" as c298,
- T3."LATEST_INV_DATE" as c299,
- T3."PAID_DATE" as c300,
- T3."HOUR_RATE_TABLE" as c301,
- T3."MAKE" as c302,
- T3."MODEL_TYPE_2" as c303,
- T3."MODEL_LINE_GROUP" as c304,
- T3."PURCH_CAL_DATE" as c305,
- T3."STOCK_DATE" as c306,
- T3."CAL_COST_DATE" as c307,
- T3."CAL_COST" as c308,
- T3."AVAILABLE" as c309,
- T3."TYPE_YEAR" as c310,
- T3."ASU_INSP" as c311,
- T3."ASU_DATE" as c312,
- T3."ASU_TYPE" as c313,
- T3."TUV_INSP" as c314,
- T3."TUV_DATE" as c315,
- T3."TUV_TYPE" as c316,
- T3."NO_OF_OWNERS" as c317,
- T3."TRIM_CODE" as c318,
- T3."COLOUR_CODE" as c319,
- T3."DRIVE_CODE" as c320,
- T3."GEAR_CODE" as c321,
- T3."MOTOR_CODE" as c322,
- T3."MISC_10_CF" as c323,
- T3."MISC_9_CF" as c324,
- T3."MISC_8_CF" as c325,
- T3."MISC_7_CF" as c326,
- T3."MISC_6_CF" as c327,
- T3."MISC_5_CF" as c328,
- T3."MISC_4_CF" as c329,
- T3."MISC_3_CF" as c330,
- T3."MISC_2_CF" as c331,
- T3."MISC_1_CF" as c332,
- T3."MILEAGE" as c333,
- T3."EQUIPMENT_4" as c334,
- T3."EQUIPMENT_3" as c335,
- T3."EQUIPMENT_2" as c336,
- T3."EQUIPMENT_1" as c337,
- T3."DECLARATION_NUMBER" as c338,
- T3."DECLARATION_PLACE" as c339,
- T3."DECLARATION_DATE" as c340,
- T3."SEATS" as c341,
- T3."CYLINDER_VOLUME" as c342,
- T3."YEAR_MODEL_CF" as c343,
- T3."KEY_CODE" as c344,
- T3."MOTOR_NUMBER" as c345,
- T3."CLASSIFICATION" as c346,
- T3."FAC_MODEL_CODE_S" as c347,
- T3."WORKSHOP_MODEL" as c348,
- T3."MODEL_LINE" as c349,
- T3."TRIM_TXT" as c350,
- T3."COLOUR_CF" as c351,
- T3."ORIG_MODEL_CODE2" as c352,
- T3."ORIG_MODEL_CODE1" as c353,
- T3."SALESMAN_SALE" as c354,
- T3."SALESMAN_BUY" as c355,
- T3."ARRIVAL_DATE" as c356,
- T3."EXPECTED_ARR_DATE" as c357,
- T3."FIRST_OCCUR_DATE" as c358,
- T3."LATEST_REG_DATE" as c359,
- T3."FIRST_REG_DATE" as c360,
- T3."FAC_MODEL_CODE_L" as c361,
- T3."CAR_STATUS" as c362,
- T3."CAR_GROUP" as c363,
- T3."REGISTER_NUMBER" as c364,
- T3."HANDLER" as c365,
- T3."TRANSACT_DATE" as c366,
- T3."BASIS_NUMBER" as c367,
- CASE WHEN (T1."ECC_STATUS" = '21') THEN ('21 - Lagerauftrag') WHEN (T1."ECC_STATUS" = '24') THEN ('24 - Kundenauftrag') WHEN (T1."ECC_STATUS" = '41') THEN ('41 - Bestand') WHEN (T1."ECC_STATUS" = '44') THEN ('44 - auf Lager verkauft') WHEN (T1."ECC_STATUS" = '64') THEN ('64 - verkauft') WHEN (T1."ECC_STATUS" = '42') THEN ('42') ELSE null END as c368,
- T2."VEHICLE_TYPE_TEXT" as c369,
- T2."VEHICLE_TYPE" as c370,
- T1."UNIQUE_IDENT" as c371,
- T1."PRICE_LIST_DATE" as c372,
- T1."PRICE_LIST_VERSION" as c373,
- T1."PURCH_ORIGIN_CODE" as c374,
- T1."SALE_PRICE_DATE" as c375,
- T1."BUD_OPT_PRICE" as c376,
- T1."RECEPTION_DATE" as c377,
- T1."EST_REFERENCE_NO" as c378,
- T1."EST_SALES_PRICE" as c379,
- T1."FORD_INT_DATE" as c380,
- T1."VALUATION_DATE" as c381,
- T1."DESIRED_DELIV_DATE" as c382,
- T1."BOOKING_DEALER_NR" as c383,
- T1."DEALER_MARKING" as c384,
- T1."EXP_ARRIVAL_TIME" as c385,
- T1."CONTRACT_DATE" as c386,
- T1."CNTRACT_DUE_DATE" as c387,
- T1."TRANSFER_VAT_RC" as c388,
- T1."VAT_RATE_CODE" as c389,
- T1."VAT_TABLE_NORMAL" as c390,
- T1."VAT_TABLE_WORK" as c391,
- T1."PRICE_LABEL_DATE" as c392,
- T1."ORDER_CONFIRM_DATE" as c393,
- T1."ORDER_ARRIVAL_DATE" as c394,
- T1."TRF_DEPARTMENT" as c395,
- T1."UNIT_SOLD" as c396,
- T1."SALE_ORDER_NO" as c397,
- T1."TRF_TAXBASIS_PURCH" as c398,
- T1."TRF_TAXBASIS_SALES" as c399,
- T1."FREIGHT_BALANCE" as c400,
- T1."RESERVATION_TEXT" as c401,
- T1."RESERVATION_PERSON" as c402,
- T1."RESERVATION_DATE" as c403,
- T1."DELIVERY_DATE_VEH" as c404,
- T1."COMMISION_NO" as c405,
- T1."RECALC_CODE" as c406,
- T1."BUDG_PRICE_VAT" as c407,
- T1."ACCOUNT_SALES" as c408,
- T1."ACCOUNT_PURCHASE" as c409,
- T1."INVOICE_PERMISSION" as c410,
- T1."LATEST_UPDATE" as c411,
- T1."VEHICLE_UPDATE" as c412,
- T1."PA_NUMBER" as c413,
- T1."BUYING_ORDER_DATE" as c414,
- T1."BUYING_ORDER_NO" as c415,
- T1."CONDITION_UNIT" as c416,
- T1."TRANSFER_BBDB" as c417,
- T1."DELETE_PROPOSAL" as c418,
- T1."STOCK_DAYS" as c419,
- T1."TRANSFER_DATE" as c420,
- T1."OR_MARK" as c421,
- T1."COST_TAX" as c422,
- T1."PURCH_TAX" as c423,
- T1."TRANSFER_SOLD" as c424,
- T1."TRANSFER_TAX_PCT" as c425,
- T1."TRANSFER_TAX_BASIS" as c426,
- T1."TRANSFER_ACC_CODE" as c427,
- T1."TRANSFER_TAX_HAND" as c428,
- T1."TRANSFER_LINE" as c429,
- T1."NEXT_LINE_1" as c430,
- T1."NEXT_LINE_UNIT" as c431,
- T1."INTEREST_2" as c432,
- T1."INTEREST_1" as c433,
- T1."REG_FEE" as c434,
- T1."SALES_PRICE_UNIT" as c435,
- T1."COST_UNIT" as c436,
- T1."PURCH_PRICE_UNIT" as c437,
- T1."OWNER" as c438,
- T1."PREV_OWNER" as c439,
- T1."BUD_DEDUCT_FEE" as c440,
- T1."BUD_REG_FEE" as c441,
- T1."BUD_PURCH_PRICE" as c442,
- T1."UNIT_IN_CHANGE" as c443,
- T1."SCRAP_CODE" as c444,
- T1."SALE_DATE" as c445,
- T1."SALE_INV_NUMBER" as c446,
- T1."SALE_SALESMAN" as c447,
- T1."SALES_DEPARTMENT" as c448,
- T1."PURCH_DATE" as c449,
- T1."PURCH_INVNO" as c450,
- T1."PURCH_SALSMAN_CODE" as c451,
- T1."PURCH_DEPARTMENT" as c452,
- T1."MILEAGE" as c453,
- T1."INTEREST_CODE" as c454,
- T1."TAX_HANDLING" as c455,
- T1."BOOK_KEEPING_CODE" as c456,
- T1."TRANSFER_TAX" as c457,
- T1."DEPRECIATION" as c458,
- T1."UNIT_LAST_UPD_DTE" as c459,
- T1."TAX_CODE" as c460,
- T1."INTERNAL_CODE" as c461,
- T1."DISCOUNT_LIMIT" as c462,
- T1."DISCOUNT_PERC_WORK" as c463,
- T1."PRICE_CODE" as c464,
- T1."DELIVERY_STOP_CODE" as c465,
- T1."SMALL_INV_CHARGE" as c466,
- T1."SMALL_ACCESSORIES" as c467,
- T1."PMT_TERM" as c468,
- T1."CAR_CREATION_DATE" as c469,
- T1."HANDLER" as c470,
- T1."TRANSACT_DATE" as c471,
- T1."VEHICLE_TYPE" as c472,
- T1."ECC_STATUS" as c473,
- T1."BASIS_NUMBER" as c474
- from ((((((((("deop01"."dbo"."UNIT_FILE" T1 left outer join "deop01"."dbo"."vPP5R" T2 on T1."VEHICLE_TYPE" = T2."VEHICLE_TYPE") left outer join "deop01"."dbo"."VEHICLE" T3 on T1."BASIS_NUMBER" = T3."BASIS_NUMBER") left outer join "deop01"."dbo"."vPP5Q" T4 on (T3."MODEL_LINE" = T4."MODEL_LINE") and (T3."MAKE_CD" = T4."MAKE_CD")) left outer join "deop01"."dbo"."vPP74" T5 on (T3."WORKSHOP_MODEL" = T5."WORKSHOP_MODEL") and (T3."MAKE_CD" = T5."MAKE_CD")) left outer join "deop01"."dbo"."UNIT_CHANGE_HIST" T6 on (T6."UNIT_NUMBER" = T1."UNIT_NUMBER") and (T6."DEPARTMENT" <> ' ')) left outer join "deop01"."dbo"."DEPARTMENT_TYPE" T7 on T1."PURCH_DEPARTMENT" = T7."DEPARTMENT_TYPE_ID") left outer join "deop01"."dbo"."GLOBAL_MAKE" T8 on T3."MAKE_CD" = T8."GLOBAL_MAKE_CD") left outer join "deop01"."dbo"."UNIT_HISTORY" T9 on T1."UNIT_NUMBER" = T9."UNIT_NUMBER") left outer join "deop01"."dbo"."vPP43" T10 on T1."PURCH_SALSMAN_CODE" = T10."SELLER_CODE")
- where (T1."ECC_STATUS" IN ('21','24','25','41','42','44'))
- ) D2
- ) D1
- where (c234 = c242)
- order by c1 asc,c220 desc
- END SQL
- COLUMN,0,Unit Number
- COLUMN,1,Basis Number
- COLUMN,2,Ecc Status
- COLUMN,3,Vehicle Type
- COLUMN,4,Transact Date
- COLUMN,5,Handler
- COLUMN,6,Car Creation Date
- COLUMN,7,Pmt Term
- COLUMN,8,Small Accessories
- COLUMN,9,Small Inv Charge
- COLUMN,10,Delivery Stop Code
- COLUMN,11,Price Code
- COLUMN,12,Discount Perc Work
- COLUMN,13,Discount Limit
- COLUMN,14,Internal Code
- COLUMN,15,Tax Code
- COLUMN,16,Unit Last Upd Dte
- COLUMN,17,Depreciation
- COLUMN,18,Transfer Tax
- COLUMN,19,Book Keeping Code
- COLUMN,20,Tax Handling
- COLUMN,21,Interest Code
- COLUMN,22,Mileage
- COLUMN,23,Purch Department
- COLUMN,24,Purch Salsman Code
- COLUMN,25,Purch Invno
- COLUMN,26,Purch Date
- COLUMN,27,Sales Department
- COLUMN,28,Sale Salesman
- COLUMN,29,Sale Inv Number
- COLUMN,30,Sale Date
- COLUMN,31,Scrap Code
- COLUMN,32,Unit In Change
- COLUMN,33,Bud Sale Det
- COLUMN,34,Bud Purch Price
- COLUMN,35,Bud Reg Fee
- COLUMN,36,Bud Deduct Fee
- COLUMN,37,Bud Cost
- COLUMN,38,Prev Owner
- COLUMN,39,Owner
- COLUMN,40,Purch Price Unit
- COLUMN,41,Cost Unit
- COLUMN,42,Sales Price Unit
- COLUMN,43,Reg Fee
- COLUMN,44,Interest 1
- COLUMN,45,Interest 2
- COLUMN,46,Next Line Unit
- COLUMN,47,Next Line 1
- COLUMN,48,Transfer Line
- COLUMN,49,Transfer Tax Hand
- COLUMN,50,Transfer Acc Code
- COLUMN,51,Transfer Tax Basis
- COLUMN,52,Transfer Tax Pct
- COLUMN,53,Transfer Sold
- COLUMN,54,Purch Tax
- COLUMN,55,Cost Tax
- COLUMN,56,Or Mark
- COLUMN,57,Transfer Date
- COLUMN,58,Stock Days
- COLUMN,59,Delete Proposal
- COLUMN,60,Transfer Bbdb
- COLUMN,61,Condition Unit
- COLUMN,62,Buying Order No
- COLUMN,63,Buying Order Date
- COLUMN,64,Pa Number
- COLUMN,65,Vehicle Update
- COLUMN,66,Latest Update
- COLUMN,67,Invoice Permission
- COLUMN,68,Location Code
- COLUMN,69,Account Purchase
- COLUMN,70,Account Sales
- COLUMN,71,Budg Price Vat
- COLUMN,72,Recalc Code
- COLUMN,73,Commision No
- COLUMN,74,Delivery Date Veh
- COLUMN,75,Reservation Date
- COLUMN,76,Reservation Person
- COLUMN,77,Reservation Text
- COLUMN,78,Freight Balance
- COLUMN,79,Trf Taxbasis Sales
- COLUMN,80,Trf Taxbasis Purch
- COLUMN,81,Sale Order No
- COLUMN,82,Unit Sold
- COLUMN,83,Trf Department
- COLUMN,84,Order Arrival Date
- COLUMN,85,Order Confirm Date
- COLUMN,86,Price Label Date
- COLUMN,87,Vat Table Work
- COLUMN,88,Vat Table Normal
- COLUMN,89,Vat Rate Code
- COLUMN,90,Transfer Vat Rc
- COLUMN,91,Cntract Due Date
- COLUMN,92,Contract Date
- COLUMN,93,Exp Arrival Time
- COLUMN,94,Dealer Marking
- COLUMN,95,Booking Dealer Nr
- COLUMN,96,Desired Deliv Date
- COLUMN,97,Valuation Date
- COLUMN,98,Ford Int Date
- COLUMN,99,Est Sales Price
- COLUMN,100,Est Reference No
- COLUMN,101,Reception Date
- COLUMN,102,Bud Opt Price
- COLUMN,103,Sale Price Date
- COLUMN,104,Purch Origin Code
- COLUMN,105,Price List Version
- COLUMN,106,Price List Date
- COLUMN,107,Unique Ident
- COLUMN,108,Vehicle Type
- COLUMN,109,Vehicle Type Text
- COLUMN,110,ECC_Status_Text
- COLUMN,111,Basis Number
- COLUMN,112,Transact Date
- COLUMN,113,Handler
- COLUMN,114,Register Number
- COLUMN,115,Chassis Number
- COLUMN,116,Car Group
- COLUMN,117,Car Status
- COLUMN,118,Fac Model Code L
- COLUMN,119,First Reg Date
- COLUMN,120,Latest Reg Date
- COLUMN,121,First Occur Date
- COLUMN,122,Expected Arr Date
- COLUMN,123,Arrival Date
- COLUMN,124,Salesman Buy
- COLUMN,125,Salesman Sale
- COLUMN,126,Model Text
- COLUMN,127,Orig Model Code1
- COLUMN,128,Orig Model Code2
- COLUMN,129,Colour Cf
- COLUMN,130,Trim Txt
- COLUMN,131,Model Line
- COLUMN,132,Workshop Model
- COLUMN,133,Fac Model Code S
- COLUMN,134,Classification
- COLUMN,135,Motor Number
- COLUMN,136,Key Code
- COLUMN,137,Year Model Cf
- COLUMN,138,Cylinder Volume
- COLUMN,139,Seats
- COLUMN,140,Declaration Date
- COLUMN,141,Declaration Place
- COLUMN,142,Declaration Number
- COLUMN,143,Equipment 1
- COLUMN,144,Equipment 2
- COLUMN,145,Equipment 3
- COLUMN,146,Equipment 4
- COLUMN,147,Mileage
- COLUMN,148,Misc 1 Cf
- COLUMN,149,Misc 2 Cf
- COLUMN,150,Misc 3 Cf
- COLUMN,151,Misc 4 Cf
- COLUMN,152,Misc 5 Cf
- COLUMN,153,Misc 6 Cf
- COLUMN,154,Misc 7 Cf
- COLUMN,155,Misc 8 Cf
- COLUMN,156,Misc 9 Cf
- COLUMN,157,Misc 10 Cf
- COLUMN,158,Motor Code
- COLUMN,159,Gear Code
- COLUMN,160,Drive Code
- COLUMN,161,Colour Code
- COLUMN,162,Trim Code
- COLUMN,163,No Of Owners
- COLUMN,164,Tuv Type
- COLUMN,165,Tuv Date
- COLUMN,166,Tuv Insp
- COLUMN,167,Asu Type
- COLUMN,168,Asu Date
- COLUMN,169,Asu Insp
- COLUMN,170,Type Year
- COLUMN,171,Available
- COLUMN,172,Cal Cost
- COLUMN,173,Cal Cost Date
- COLUMN,174,Stock Date
- COLUMN,175,Purch Cal Date
- COLUMN,176,Model Line Group
- COLUMN,177,Model Type 2
- COLUMN,178,Make
- COLUMN,179,Hour Rate Table
- COLUMN,180,Paid Date
- COLUMN,181,Latest Inv Date
- COLUMN,182,Purch Amount
- COLUMN,183,Dealer Number
- COLUMN,184,Dealer Marking
- COLUMN,185,Fueltype
- COLUMN,186,Service Days
- COLUMN,187,Hourly Repair Rate
- COLUMN,188,Workshop Pricecode
- COLUMN,189,Discount Perc Work
- COLUMN,190,Soldmark Date
- COLUMN,191,Make Cd
- COLUMN,192,Model Line
- COLUMN,193,Mod Lin Specify
- COLUMN,194,Make Cd
- COLUMN,195,Workshop Model
- COLUMN,196,Make Cd
- COLUMN,197,Model Text
- COLUMN,198,Orig Model Code
- COLUMN,199,Model Type
- COLUMN,200,Model Group
- COLUMN,201,Make Code
- COLUMN,202,Hauptbetrieb
- COLUMN,203,Standort
- COLUMN,204,Department Type Id
- COLUMN,205,Description
- COLUMN,206,Fahrzeugart
- COLUMN,207,Fabrikat_ori
- COLUMN,208,Model
- COLUMN,209,Modellbez
- COLUMN,210,Fahrgestellnr
- COLUMN,211,Farbe
- COLUMN,212,FZG
- COLUMN,213,Fahrzeugtyp
- COLUMN,214,Global Make Cd
- COLUMN,215,Description
- COLUMN,216,Einsatz
- COLUMN,217,Menge
- COLUMN,218,Heute
- COLUMN,219,Standtage
- COLUMN,220,Standtagestaffel
- COLUMN,221,Car Letter
- COLUMN,222,Fahrzeugart_Konsi
- COLUMN,223,kalk_Kosten
- COLUMN,224,Betrieb
- COLUMN,225,Seller Code
- COLUMN,226,Sel Name
- COLUMN,227,VB_Einkauf
- COLUMN,228,geplante Kosten
- COLUMN,229,tatsächl. Kosten
- COLUMN,230,geplanter VK
- COLUMN,231,Fabrikat
- COLUMN,232,Department_unique_change_history
- COLUMN,233,Unique Ident_unique_change_history
- COLUMN,234,MAXIMUM ( Unique Ident_unique_change_history )
- COLUMN,235,KST EK
- COLUMN,236,Mandant
- COLUMN,237,Transaction Code
- COLUMN,238,Costs
- COLUMN,239,Orders Grossvalue
- COLUMN,240,Reference
|