verkaeufer_aktiv_struktur.sql 981 B

1234567891011121314
  1. select T1."User ID" as "User Id",
  2. T1."Employee No_" as "Employee No",
  3. T1."Salesperson" as "Salesperson",
  4. T2."No_" as "No",
  5. T2."First Name" as "First Name",
  6. T2."Last Name" as "Last Name",
  7. T2."Name" as "Name",
  8. T2."Status" as "Status",
  9. T2."Inactive Date" as "Inactive Date",
  10. T2."Termination Date" as "Termination Date",
  11. 'aktive Verkäufer' as "Verkäufer / Sonstige"
  12. from ("NAVISION"."import"."User_Setup" T1 left outer join "NAVISION"."import"."Employee" T2 on ((((((T2."No_" = T1."Employee No_") and (T2."Status" = 0)) and (T2."Inactive Date" = convert(datetime, '1753-01-01 00:00:00.000'))) and (T2."Termination Date" = convert(datetime, '1753-01-01 00:00:00.000'))) and (T1."Salesperson" <> ' ')) and (T1."Salesperson" <> 'DIV')) and (T2."Client_DB" = T1."Client_DB"))
  13. where (((T1."Salesperson" <> ' ') and (not T1."Salesperson" IN ('DIV','BMWREL'))) and ((convert(float, T1."Salesperson")) BETWEEN 100 AND 999))
  14. -- order by "Salesperson" asc