New Query Report

New Query Report

Hi,
I have created  a new query report to extract all users information and create a phonebook. I have added 2 'User Additional Fields', one called 'Extension' and the other one called 'Status'.
I have the following query already:

SELECT aa.FIRST_NAME "FullName", dept.DEPTNAME "Department",sdorg.NAME "Site",aacontact.LANDLINE "Phone",sd.JOBTITLE "JobTitle",aacontact.MOBILE "Mobile" FROM AaaUser aa LEFT JOIN UserDepartment userdept ON aa.USER_ID=userdept.USERID LEFT JOIN AAAUserContactInfo aausercontact ON aa.USER_ID=aausercontact.USER_ID LEFT JOIN AaaContactInfo aacontact ON aausercontact.CONTACTINFO_ID=aacontact.CONTACTINFO_ID LEFT JOIN DepartmentDefinition dept ON userdept.DEPTID=dept.DEPTID LEFT JOIN SiteDefinition site ON dept.SITEID=site.SITEID LEFT JOIN SDOrganization sdorg ON site.SITEID=sdorg.ORG_ID INNER JOIN SDUser sd ON aa.USER_ID=sd.USERID LEFT JOIN HelpDeskCrew helpdeskcrew ON sd.USERID=helpdeskcrew.TECHNICIANID LEFT JOIN AaaLogin al ON aa.USER_ID=al.USER_ID WHERE ((helpdeskcrew.TECHNICIANID IS NULL) AND (sd.STATUS = 'ACTIVE')) ORDER BY 2

Which gives me: Fullname, Site, Phone (Landline), JobTitle, Mobile columns.

I would like to add the 2 additional fields I have created to this query. The 'Status' field is a pick list, if status is 'Yes', users need to show on the query, if the status is blank or 'No', do not show on the query.

Are you able to assist, thank you.

                New to ADManager Plus?

                  New to ADSelfService Plus?