Skip to content

Instantly share code, notes, and snippets.

@FembotDBA
Created June 13, 2013 00:32
Show Gist options
  • Save FembotDBA/5770317 to your computer and use it in GitHub Desktop.
Save FembotDBA/5770317 to your computer and use it in GitHub Desktop.
output employee details to create folders
SELECT 'set objShell = CreateObject("Shell.Application") set objFolder = objShell.NameSpace(ParentFolder) objFolder.NewFolder "' +
a1.EMPLOYEE_NAME + '"'
from LU_HR_EMPLOYEES a1
join LU_HR_EMPLOYEE_STATUS a2
on (a1.EMPLOYEEID = a2.EMPLOYEEID and a1.NATIONALID = a12.NATIONALID)
join LU_HR_EMPLOYEE_STUDIO a3
on (a1.EMPLOYEEID = a3.EMPLOYEEID and a1.NATIONALID = a13.NATIONALID)
join LU_HR_STUDIO a4
on (a3.STUDIO_ID = a4.STUDIO_ID)
where a2.STATUS_ID in (3, 1) --active or on leave
and a3.studio_id = 30 --or whichever studio I need
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment