功能帮助 [英] Function Help

查看:60
本文介绍了功能帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好:


我正在尝试创建一个能够执行以下操作的功能:


1)每隔30天,检查一次看看任何部门的任何成员是否有与他们相关的事件


2)如果是这样,整个部门都没有资格享受

当月以及下个月


3)如果没有,整个部门将获得4小时的休假时间

for新的一个月,增加了他们现在所拥有的。


例如:


剥离工作人员发生了一起事件3月份加载

船员。所以剥离工作人员将失去四月的假期和

五月。他们下次有资格休假的时间是六月。

装载人员将在4月份获得4个休假时间。


我有一个查询按部门确定员工事件...我是

创建一个查询,以确定是否有任何部门有

发生事故...如果计数返回为如果它返回false(意味着没有部门发生事故)

那么,每个员工的工作时间将增加4小时。我很难理解该怎么做的部分是我们没有的部分

允许员工获得两个月的假期。

我感谢您提供的任何输入。

Hello:

I am trying to create a function that will do the following:

1) Every 30 days, check to see if any members of any department have
an incident associated with them

2) If so, the entire department is ineligible for vacation for the
current month as well as the next month

3) If not, the entire department will be awarded 4 hours of leave time
for the new month, added to what they currently have.

For instance:

There was one incident for the stripping crew and none for the loading
crew in March. so the stripping crew would lose leave for April and
May. The next time they would be eligible for leave would be June.
The Loading crew would be awarded 4 leave hours for April.

I have a query that determines employee incidents by department...I am
creating a query that will count to determine if any department has
had an incident...if the count comes back as true then do nothing, but
if it comes back false (meaning no departments have had incidents)
then 4 hours will be added to each employees earned time. The part I
am struggling to understand how to do is the part where we do not
allow an employee to earn leave for two months.

I appreciate any input you can provide.

推荐答案

您可能需要创建一个包含部门及其当前状态的表,表示允许或不允许,每月运行此过程时更新。
You may have to create a table with departments and their current status, signifying allowed or not allowed, which you update when you run this process each month.


除非您希望数据库被锁定30天,否则无法在函数内完成。

我建议你需要重新考虑你的要求。


您是否考虑过如果获得额外假期会发生什么?

地点和方式它将被存储?
Unless you want the database to be locked up for 30 days then this cannot be done within a function.

I suggest you need to rethink your requirement.

Have you considered even what will happen should extra leave be awarded?
Where and how it will be stored?


@NeoPa


您是什么意思重新考虑我的要求?系统的规则是部门每30天评估一次。如果任何部门发生事故,该部门的所有员工将在接下来的2个月内受到处罚。这些是我给出的系统的要求。


我相信如果我正确地设计我的系统,将不会给予额外的假期。我有一个tblVacationTime,可以跟踪已经度过假期的员工。


tblVacationTime - 跟踪假期获得

vacaID - PK,数字

empID-FK(员工表),数量

vacaStartAmt-Number - 让员工入手

vacaTimeEarned-Number - 留下的收入

vacaTimeUsed-Number - 留下使用

vacaAwardDate-日期 - 获得日期奖励


tblVacaHistory - 跟踪度假历史

vacaHistID-PK,数字

vacaID-FK(vacatimeTime)-Number


我只需要弄明白如何制作它,以便如果一个部门在接下来的两个月内发生事故,他们就没有资格参加请假。我创建了一个查询,empIncidents告诉我当前月份的事件。
@NeoPa
What do you mean rethink my requirement? The rules of the system are that departments are evaluated every 30 days. If any department has an incident, all employees of that department are penalized for the next 2 months. these are the requirements of the system that i was given.

I believe if I design my system correctly, extra leave will not be awarded. I have a tblVacationTime that keeps track of employees who have earned vacation Time.

tblVacationTime--Tracks Vacation Earned
vacaID--PK, Number
empID-FK (Employee Table), Number
vacaStartAmt-Number--Leave employee starts with
vacaTimeEarned-Number--leave earned
vacaTimeUsed-Number--Leave Used
vacaAwardDate-Date--Date Leave Awarded

tblVacaHistory--Tracks Vacation History
vacaHistID-PK, Number
vacaID-FK (vacatimeTime)-Number

I just need to figure out how to make it so that if a department has an incident for the next two months they will not be qualified to receive leave. I created a query, empIncidents that tells me incidents for the current month.
展开 | 选择 | Wrap | 行号


这篇关于功能帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆