Database Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesDatabase 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 June 17th, 2009, 09:34 PM
antz antz is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 2 antz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m 26 sec
Reputation Power: 0
Ms access query for an employee management system

i am seeking assistance in designing a query/macro/script for an employee management system that allows for the followin functions: -

my system is supposed to be capable of deducting the an instance of every leave taken from the total alloted days granted per year. i need a query or script that works similar to an inventory system where every time a leave is registered against an employee it deducts from the maximum allotted days.

i hav the tables employee leave and leave. the leave table specifies the max allotted days - DSL/MOH has a maximum of 14 days and CL has a maximum of 5.

attributes in the employee leave table are :- Leave ID, employee No*, Start Date, End Date, Duration, Days Paid For, Date Entered, Approval Date, Leave Type ID

Leave table:- [Leave Type ID, Leave Name]


your assistance is greatly appreciated

Reply With Quote
  #2  
Old June 20th, 2009, 11:46 AM
dykebert's Avatar
dykebert dykebert is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 408 dykebert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 Days 20 h 27 m 28 sec
Reputation Power: 2
You have only listed the tables that track the leave an employee has taken (Employee leave) and the table that specifies the type of leave.

You say that the leave table specifies the max alloted days, but you haven't provided the column names that do that.

Based on the design you have provided my guess is that the values for the leave table are similar to:

1 : Holiday
2 : Sick
3 : Vacation
etc.

Is this correct?

You haven't provided anything that tracks the count or number of days that an employee is entitled based on their classification (DSL/MOH or CL).

Given this lack of information the best I can do is to provide a base count of days taken by an employee.

SELECT Sum(Duration) as Leave_Taken, [employee no*], Year([Start Date])
FROM Employee leave
GROUP BY [employee no*], Year([Start Date])

This just uses calendar date for summing the leave taken and doesn't account for someone taking leave that crosses the new year. You would need to provide additional information to make this more accurate.


Quote:
Originally Posted by antz

i hav the tables employee leave and leave. the leave table specifies the max allotted days - DSL/MOH has a maximum of 14 days and CL has a maximum of 5.

attributes in the employee leave table are :- Leave ID, employee No*, Start Date, End Date, Duration, Days Paid For, Date Entered, Approval Date, Leave Type ID

Leave table:- [Leave Type ID, Leave Name]
__________________
P.S. I am looking for work. <grin>.

Reply With Quote
  #3  
Old June 22nd, 2009, 07:01 PM
antz antz is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 2 antz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m 26 sec
Reputation Power: 0
ms access query/macro/script

Quote:
Originally Posted by dykebert
You have only listed the tables that track the leave an employee has taken (Employee leave) and the table that specifies the type of leave.

You say that the leave table specifies the max alloted days, but you haven't provided the column names that do that.

Based on the design you have provided my guess is that the values for the leave table are similar to:

1 : Holiday
2 : Sick
3 : Vacation
etc.

Is this correct?

You haven't provided anything that tracks the count or number of days that an employee is entitled based on their classification (DSL/MOH or CL).

Given this lack of information the best I can do is to provide a base count of days taken by an employee.

SELECT Sum(Duration) as Leave_Taken, [employee no*], Year([Start Date])
FROM Employee leave
GROUP BY [employee no*], Year([Start Date])

This just uses calendar date for summing the leave taken and doesn't account for someone taking leave that crosses the new year. You would need to provide additional information to make this more accurate.



tanx for the info but you sorta lost me.
as it is now, i can do a select query to list all the DSL/MOH and CL that any given employee has taken for the current year. what i need is something that would perform calculations to count the leave balance of DSL/MOH and CL..... once that has been accomplished, i would then need to figure out how to reset the maximum alloted days each year. i hope you understand what i am tryin to do

i eagerly await your response

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesDatabase Development > Ms access query for an employee management system


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




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

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




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek