I am a very novice sql user who really just trys different things until it works not really knowing why. So when I was asked to create a query that gives basic employee data with a count of active dependants I created the following query that works in Toad and in the crystal designer but when I publish it to LBI it doesn't recognize the datasource. is there a different way to write it so it will accomplish the same thing and be published to LBI? SELECT a.employee, TRIM(a.LAST_NAME)||', '||TRIM(a.FIRST_NAME)||' '||TRIM(a.MIDDLE_INIT) NAME, a.process_level, a.PL_NAME, a.DEPT_NAME, a.TITLE, TRIM(a.SUP_LAST_NAME)||', '||TRIM(a.SUP_FIRST_NAME) SUP_NAME, (SELECT COUNT(LAWPROD.EMDEPEND.LAST_NAME) TTL_DEP FROM LAWPROD.EMDEPEND INNER JOIN LAWPROD.EMPLOYEE ON LAWPROD.EMDEPEND.COMPANY = LAWPROD.EMPLOYEE.COMPANY AND LAWPROD.EMDEPEND.EMPLOYEE = LAWPROD.EMPLOYEE.EMPLOYEE WHERE LAWPROD.EMPLOYEE.EMP_STATUS LIKE 'A%' AND LAWPROD.EMDEPEND.ACTIVE_FLAG='A' AND LAWPROD.EMDEPEND.EMPLOYEE=a.employee OR LAWPROD.EMPLOYEE.EMP_STATUS LIKE 'L%' AND LAWPROD.EMDEPEND.ACTIVE_FLAG='A' AND LAWPROD.EMDEPEND.EMPLOYEE=a.employee GROUP BY LAWPROD.EMPLOYEE.COMPANY, LAWPROD.EMDEPEND.EMPLOYEE, lawprod.employee.last_name ) ttl_dep, a.addr1, a.addr2, a.city, a.state, a.zip FROM (SELECT LAWPROD.EMPLOYEE.COMPANY, LAWPROD.EMPLOYEE.EMPLOYEE, LAWPROD.EMPLOYEE.LAST_NAME, LAWPROD.EMPLOYEE.FIRST_NAME, LAWPROD.EMPLOYEE.MIDDLE_INIT, LAWPROD.EMPLOYEE.PROCESS_LEVEL, LAWPROD.PRSYSTEM.R_NAME PL_NAME, LAWPROD.DEPTCODE.R_NAME DEPT_NAME, LAWPROD.PAPOSITION.DESCRIPTION TITLE, LAWPROD.EMPLOYEE_1.LAST_NAME SUP_LAST_NAME, LAWPROD.EMPLOYEE_1.FIRST_NAME SUP_FIRST_NAME, LAWPROD.EMPLOYEE.ADDR1, LAWPROD.EMPLOYEE.ADDR2, LAWPROD.EMPLOYEE.CITY, LAWPROD.EMPLOYEE.STATE, LAWPROD.EMPLOYEE.ZIP FROM LAWPROD.EMPLOYEE INNER JOIN LAWPROD.DEPTCODE ON LAWPROD.EMPLOYEE.PROCESS_LEVEL = LAWPROD.DEPTCODE.PROCESS_LEVEL AND LAWPROD.EMPLOYEE.DEPARTMENT = LAWPROD.DEPTCODE.DEPARTMENT AND LAWPROD.EMPLOYEE.COMPANY = LAWPROD.DEPTCODE.COMPANY INNER JOIN LAWPROD.PRSYSTEM ON LAWPROD.EMPLOYEE.PROCESS_LEVEL = LAWPROD.PRSYSTEM.PROCESS_LEVEL AND LAWPROD.EMPLOYEE.COMPANY = LAWPROD.PRSYSTEM.COMPANY LEFT JOIN LAWPROD.HRSUPER LEFT JOIN LAWPROD.EMPLOYEE EMPLOYEE_1 ON LAWPROD.HRSUPER.EMPLOYEE = EMPLOYEE_1.EMPLOYEE AND LAWPROD.HRSUPER.COMPANY = EMPLOYEE_1.COMPANY ON LAWPROD.EMPLOYEE.SUPERVISOR = LAWPROD.HRSUPER.CODE AND LAWPROD.EMPLOYEE.COMPANY = LAWPROD.HRSUPER.COMPANY LEFT JOIN LAWPROD.PAPOSITION ON LAWPROD.EMPLOYEE.COMPANY = LAWPROD.PAPOSITION.COMPANY AND LAWPROD.EMPLOYEE.POSITION = LAWPROD.PAPOSITION.POSITION WHERE LAWPROD.PAPOSITION.END_DATE='01jan1700' AND LAWPROD.EMPLOYEE.EMP_STATUS LIKE 'A%' OR LAWPROD.EMPLOYEE.EMP_STATUS LIKE 'L%' AND LAWPROD.PAPOSITION.END_DATE='01jan1700') a ORDER BY a.process_level