Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
chiume
Starting Member
2 Posts |
Posted - 2006-10-10 : 14:26:42
|
| Ok, this is what I am trying to do:,1) I am trying to get the number of employees that has completed all theironline training within 10 days of hire2) All the employees that are has no exception(no pre-service training) andhas completed their checklist within 10 days3) all the exception(pre-service) employees that has completed theirtraining within 70 days.I have these tables, hipaa2006, hipaa101, hipaa201_inputs,domesticviolence, securityawareness, securityawareness2006,civilrights_input, and people_first_data.People_first_data contains all the employees we have in our database, ithas empl_pfid col, but does not have last_modified col which all the othertables has.I have this queries:1) select distinct(count(empl_pfid))from people_first_dataleft outer join tbl_domesticviolence on people_first_data.empl_pfid =tbl_domesticviolence.employee_pfid left outer join tbl_hipaa101 onpeople_first_data.empl_pfid=tbl_hipaa101.employee_pfid left outer join tbl_hipaa201_input on people_first_data.empl_pfid=tbl_hipaa201_input.employee_pfid left outer join tbl_hipaa2006 onpeople_first_data.empl_pfid=tbl_hipaa2006.employee_pfid left outer join tbl_securityawareness onpeople_first_data.empl_pfid=tbl_securityawareness.employee_pfid left outer join tbl_securityawareness2006 on people_first_data.empl_pfid=tbl_securityawareness2006.employee_pfidwhere people_first_data.empl_pfid = '639846'and tbl_domesticviolence.last_modified is not nulland tbl_hipaa101.last_modified is not nulland tbl_hipaa201_input.last_modified is not nulland tbl_hipaa2006.last_modified is not nulland tbl_securityawareness.last_modified is not nulland tbl_securityawareness2006.last_modified is not null2) ( I tried union, but i only wanted one number)select count(last_modified) as date1 from tbl_hipaa2006unionselect count(last_modified) as date2 from tbl_hipaa101Your help will be highly appreciated. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|
|
|