VetLink PRO

Connecting Veterinary Professionals with Smarter Solutions

Skip to content
English - Australia
  • There are no suggestions because the search field is empty.

SQL - Staff on Access Levels

v7,v6

See Create Export to CSV using SQL Query for information on using query below for export to csv.

Note: Access level names in export query need to be updated to match names in options -> Setup -> Staff -> Access tab,
 
select SM."Id", CM."First_Name", CM."Last_Name"
, case when SM."Access" = 0 then 'Owner'
      when SM."Access" = 1 then 'Owner'
       when SM."Access" = 2 then 'Desk'
       when SM."Access" = 3 then 'AccessC' //update name of access level here
       when SM."Access" = 4 then 'AccessD' //update name of access level here
       when SM."Access" = 5 then 'AccessE' //update name of access level here
       when SM."Access" = 6 then 'AccessF' //update name of access level here
       when SM."Access" = 7 then 'AccessG' //update name of access level here
       else '' end "Access Level"
from "Staff_Main" SM
join "Client_Main" CM on CM."Ref_Number" = SM."Cln_Link"
where SM."Status" = 'A'
and SM."Id" <> 'OWN'