jhonc66
asked on
Join Tables in SQL
Hello I have the following query which is giving me the data from the people not working on Today.
SELECT *
FROM q2employee_work_schedule
WHERE working = 'N' AND date1 = CAST(FLOOR(CAST(getdate() as FLOAT)) as DATETIME)
but is giving me an employee Code "emp_code" which is fine but I need a name, there is another table called dbo.q2employees, how can I join these two tables to get the preferred name "preferred_name" and surname
Thanks
SELECT *
FROM q2employee_work_schedule
WHERE working = 'N' AND date1 = CAST(FLOOR(CAST(getdate() as FLOAT)) as DATETIME)
but is giving me an employee Code "emp_code" which is fine but I need a name, there is another table called dbo.q2employees, how can I join these two tables to get the preferred name "preferred_name" and surname
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot
FROM q2employee_work_schedule
Inner join q2employees on q2employee_work_schedule.e
WHERE working = 'N' AND date1 = CAST(FLOOR(CAST(getdate() as FLOAT)) as DATETIME)