查询X小时病假员工的数据库 [英] Querying database for employees with X hours of sick leave

查看:57
本文介绍了查询X小时病假员工的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人,有人可以帮助我并为我编写VBA脚本以便与MS Access一起使用吗?


我对它的MS Access没有任何关于VBA脚本的知识但是真的需要一些帮助。


我在工作的服务器上有一个MS Access数据库,按小时,按日期记录员工病假。


我需要知道员工在1月1日开始并在12月31日结束的日历年中连续10个或更多工作日休病假的次数。


员工每周工作7.5小时,周一到周五,没有周末。


我以为我需要一个脚本,在每个14天的病假期间检查75小时的病假。一年。


如果算得上,那么应该有255个这样的差价:从1月1日到14日,然后是1月2日到15日,......到12月18日到31日结束。


如果员工连续工作30天,结果应该只显示一次。但是如果他上班10个工作日,又回来工作5个工作日,那么再过10个工作日,结果应该给他看两次。


我希望这是有道理的有人可以迎接挑战并把它放在一起。


谢谢


Erik Lupien

Could someone, anyone, help me and compose a VBA script for me to use with MS Access?

I know nothing about MS Access of VBA scripting for it but really need some help.

I have an MS Access database on a server at work that records employee sick leave, by hour, by date.

I need to know the number of occurences when employees were gone on sick leave for 10 or more consecutive work days, during a calendar year that starts on Jan 1 and ends on Dec 31.

Employees work 7.5 hours in a day, Monday to Friday, no weekends.

I was thinking I need a script that runs a check for 75 hours of sick leave in each 14 day spread during the year.

If I counted right, there should be 255 such spreads: Starting with Jan 1 to 14, then Jan 2 to 15, ... and ending with Dec 18 to 31.

If an employee is gone for 30 consecutive work days, the result should only show him once. But if he goes 10 work days, comes back to work for 5 work days, then goes for another 10 work days, the result should show him twice.

I hope this makes sense and that someone can rise to the challenge and put this together.

Thank you

Erik Lupien

推荐答案

Erik,我认为这个问题比你意识到的要复杂得多,至少在我的解释中。如果你没有兴奋,我会很高兴看到它,但首先要了解一些初步信息。
Erik, I think this problem is a little more complicated than you realize, at least in my interpretation of it. If you are not in any great rush I''ll be glad to have a look at it, but first some preliminary information.
  1. 什么是名字服务器上的后端数据库?
  2. 我们是在讨论后端数据库驻留在SQL Server上的Access数据库或项目吗?
  3. 包含相关内容的表名是什么?字段?
  4. 什么是字段名称及其各自的数据类型?
  5. 我在解释您的请求时是否正确,这意味着您正在寻找10次或更多次病假的所有事件连续多日?一个20天或更长时间的单一时期仍然会构成一次?


你好,我一点也不急。我非常感谢这个帮助。我并不认为这很复杂。我开始思考它并在我试图解决它时迷路了。


您的问题的答案如下,我希望它们正是您所寻找的。
Hi there, I''m not in a rush at all. I would greatly appreciate this help. And I make no illusion that this is complex. I started to think about it and got lost when I tried to figure it out.

The answers to your questions are below, I hope they are what you were looking for.
  1. 服务器上后端数据库的名称是什么?

    MDB名为LEAVE 2008
  2. 我们是在谈论后端数据库驻留在SQL Server上的Access数据库还是项目?

    这是一个Access数据库。
  3. 包含相关字段的表名是什么?

    表名是LEAVE 2007-2008
  4. 什么是字段名称及其各自的数据类型?

    字段名称为L *(长整数)

    您想要的值是2100(未休病假)和2200(认证病假)

    时数列称为CATSHOURS(双号)

    日期字段名为WORKDATE(日期字段)
  5. 我在解释您的请求时是否正确,这意味着您正在寻找所有10次病假或连续几天?单个20天或更长时间的期限仍会构成一次?

    是的,你是对的。



谢谢再次,


Erik


Thank you again,

Erik



你好,我不急所有。我非常感谢这个帮助。我并不认为这很复杂。我开始思考它并在我试图解决它时迷路了。


您的问题的答案如下,我希望它们正是您所寻找的。
Hi there, I''m not in a rush at all. I would greatly appreciate this help. And I make no illusion that this is complex. I started to think about it and got lost when I tried to figure it out.

The answers to your questions are below, I hope they are what you were looking for.
  1. 服务器上后端数据库的名称是什么?

    MDB名为LEAVE 2008
  2. 我们是在谈论后端数据库驻留在SQL Server上的Access数据库还是项目?

    这是一个Access数据库。
  3. 包含相关字段的表名是什么?

    表名是LEAVE 2007-2008
  4. 什么是字段名称及其各自的数据类型?

    字段名称为L *(长整数)

    您想要的值是2100(未休病假)和2200(认证病假)

    时数列称为CATSHOURS(双号)

    日期字段名为WORKDATE(日期字段)
  5. 我在解释您的请求时是否正确,这意味着您正在寻找所有10次病假或连续几天?单个20天或更长时间的期限仍会构成一次?

    是的,你是对的。



谢谢再次,


Erik


Thank you again,

Erik



未来几天我会很忙,但我会看看尽我所能。在此期间,请发布一些不代表病假的数据,至少10天的病假,然后再过几天没有病假。我需要在视觉上看到什么构成病假使用以及什么决定它何时是连续的。请将相关的字段名称与数据一起发布。稍后会见到你。

I will be very busy in the next few days, but I''ll have a look at it as soon as I can. In the meantime, kindly post some data that would represent no Sick Leave, at least 10 days of Sick Leave, then a few days of no Sick Leave again. I need to visually see what constitutes Sick Leave usage and what determines when it is continuous. Kindly post the relevant Field Names along with the data. Will see you later.


这篇关于查询X小时病假员工的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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