Hi,
I have to create report for only absent employee.
there are two tables
table1(employee id,date in,date out,description)
table2(employee id,description)
-----------------------------------------
The data in table1 I get it monthly from id card reader for attandence ,but the problem it sometime record only date in time and other time date out time.
I tried all thoese but its not work :
SELECT [Employee id]
FROM [table2]
WHERE ([Date in time] Is Null) And ([Date out time] Is Null);
-----------------------------------------------------
select * from Table2
left join table1 on table2.[employee id]=table1.[employee id]
where table1.[employee id] is null;
-----------------------------------------------------
SELECT Table2.*,
(select top 1 [date in] from table1) AS [Date]
FROM Table2 LEFT JOIN Table1 ON Table2.[employee id] = Table1.[employee id]
WHERE Table1.[employee id] Is Null;
------------------------------------------------------
I need a correct query that show:
only absent employee and the date.
(I should also run this query also for previous 3 months)
Thanks
I have to create report for only absent employee.
there are two tables
table1(employee id,date in,date out,description)
table2(employee id,description)
-----------------------------------------
The data in table1 I get it monthly from id card reader for attandence ,but the problem it sometime record only date in time and other time date out time.
I tried all thoese but its not work :
SELECT [Employee id]
FROM [table2]
WHERE ([Date in time] Is Null) And ([Date out time] Is Null);
-----------------------------------------------------
select * from Table2
left join table1 on table2.[employee id]=table1.[employee id]
where table1.[employee id] is null;
-----------------------------------------------------
SELECT Table2.*,
(select top 1 [date in] from table1) AS [Date]
FROM Table2 LEFT JOIN Table1 ON Table2.[employee id] = Table1.[employee id]
WHERE Table1.[employee id] Is Null;
------------------------------------------------------
I need a correct query that show:
only absent employee and the date.
(I should also run this query also for previous 3 months)
Thanks