ims.Verkaeufer_aktiv.sql 1.1 KB

1234567891011121314151617181920212223242526
  1. SET QUOTED_IDENTIFIER ON
  2. GO
  3. SET ANSI_NULLS ON
  4. GO
  5. CREATE VIEW ims.verkaeufer_aktiv AS
  6. select T1."User ID" as "User Id",
  7. T1."Employee No_" as "Employee No",
  8. T1."Salesperson" as "Salesperson",
  9. T2."No_" as "No",
  10. T2."First Name" as "First Name",
  11. T2."Last Name" as "Last Name",
  12. T2."Name" as "Name",
  13. T2."Status" as "Status",
  14. T2."Inactive Date" as "Inactive Date",
  15. T2."Termination Date" as "Termination Date"
  16. 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"))
  17. where ((((T1."Salesperson" <> ' ') and (T1."Salesperson" <> 'DIV')) and ((convert(float, T1."Salesperson")) BETWEEN 100 AND 999)) and (T2."Status" = 0))
  18. -- order by "Salesperson" asc
  19. GO
  20. SET QUOTED_IDENTIFIER OFF
  21. GO
  22. SET ANSI_NULLS OFF
  23. GO
  24. GO