Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 28th, 2005, 03:06 PM
bilal bilal is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 2 bilal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 26 sec
Reputation Power: 0
Question Urgent help for SQL Query

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

Reply With Quote
  #2  
Old February 28th, 2005, 03:16 PM
xpetex xpetex is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 56 xpetex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 50 m 7 sec
Reputation Power: 4
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.

Reply With Quote
  #3  
Old February 28th, 2005, 03:48 PM
bilal bilal is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 2 bilal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 26 sec
Reputation Power: 0
Lightbulb

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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Urgent help for SQL Query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway