|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am working on a kind of attendance system using MS Access 2000, Visual Basic 6.0 and Crystal Reports 9. My database tables are as under:
tblDepartment Dept_ID, Dept_name tblEmployees Emp_ID, Dept_ID, Emp_name, Designation tblAttendance Attendance_ID, Emp_ID, In_Time, Out_Time, Leave_Type, Date_Stamp I need help for SQL Query to generate following reports: Report 1 Absent Report Report for Employees who are absent today. Employees whose In_Time, Out_Time and Leaves (Leave_Type) is NULL are considered as Absent. Report 2 Time Report I need query for this report so that I can display Emp_ID, Emp_name, Dept_name, Designation, In_Time, Out_Time for all employees for Current Date including those employees for whom Leave_Type = ‘Short Leave’ Please help. Thanx |
|
#2
|
|||
|
|||
|
I wouldnt use null values, they can cause problems in calculations etc later on... Use something like 'absent' as the value..
Use the query designer in access to create your query if you are new to access, There is a row called condition, This is like a where statment in SQl. So right click and click 'show tables' then select the relevant tables.. tblAttendance Click all the fields into the columbs in the small table window, and in criteria for 'Leaves ( I think) put 'Is Null', or as I would do put "Absent" but this requires that you have a script to enter "Absent" when they are not there. Then for Date_stamp pu Date() in the criteria I think something like that should work. |
|
#3
|
|||
|
|||
|
Actually attendance is done through a BarCode Slot Reader. Employees swap card and their Emp_ID, In_Time is added in the tblAttendance. So I need an SQL Query using which I can generate above reports. I think that JOINing tblEmployees anb tblAttendance will help generating report because absent employees can't be simply fetched from tblAttendance only, it only keeps record of employees who swap their card and for whom leave is entered manually. So whats the solution...?? pls hep.
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Urgent help for SQL Query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|