Hi, Today management asked me to get quick data absent every day for the employee who did not enter or his data did not enter the absent machine, then I tried to modify the program absent that I created and put the SQL command as follows:
Ex :
Table1
Id_number | name | Department |
A0001 | David | Finance |
A0002 | Rahul | Finance |
A0003 | Robert | Finance |
B0001 | Diana | Finance |
B0002 | Fabio | Finance |
B0003 | Budi | Finance |
Id_number | Date |
A0001 | 09/14/2008 |
A0002 | 09/14/2008 |
A0003 | 09/15/2008 |
B0001 | 09/15/2008 |
B0002 | 09/15/2008 |
B0003 | 09/15/2008 |
SELECT DISTINCT (dbo. Table2.kode), dbo. Table1.kode, dbo. Table1.nama, dbo. Table1.department FROM dbo. Table2 RIGHT OUTER JOIN dbo. Table1 ON dbo. Table2.kode = dbo. Table1.kode'Where dbo. Table1.kode NOT IN (select dbo. Table2.kode from dbo.Table2 WHERE tanggal = ‘09/15/2008) and dbo. Table1.department = ‘Finance’
Related Topics:
How to connect Delphi to database SQL Server
Select Distinct, Not In and Right Outer Join in SQL Command
How To Import Data Excel To SQL Server 2005
Function Date and Time in Foxpro
No comments:
Post a Comment