0

I have 2 table
[EMPLOYEE]
Emp_ID
Emp_Name

[ATTENDANCE]
Emp_ID
Emp_Name
Time_In
Time_Out

How do I display it like this.
I hope I present this right

+--------++----------++---------++---------+
| Emp_ID || Emp_Name || Time_In ||Time_Out | <---- FROM ATTENDANCE
+--------++----------++---------++---------+
|   1    ||   Josh   ||         ||         | <---- FROM EMPLOYEE
+--------++----------++---------++---------+
|   2    ||   Carl   ||         ||         | <---- FROM EMPLOYEE
+--------++----------++---------++---------+

Edited by Shizuo: n/a

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by adam_k
0

I really don't understand what the question is.
There are a million possibilities for your result sample:

select employee.emp_id,employee.Emp_Name,attendance.Time_In,attendance.Time_Out
from employee inner join attendance 
on employee.emp_id = attendance.emp_id 
and time_id = ''
and time_out = ''
select attendance.emp_id,attendace.Emp_Name,attendance.Time_In,attendance.Time_Out
from employee left join attendance
on employee.emp_id = attendance.emp_id 
where attendance.emp_id is null
select top 0 * from attendance 
union select emp_id,emp_name,'','' 
from employee

Probably all the above will give a similar result to what you've provided under some conditions. The problem is that you have to specify under what you are trying to do.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.