如何为Access 2003转换Excel公式 [英] How to convert Excel Formula for Access 2003

查看:74
本文介绍了如何为Access 2003转换Excel公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是程序员 - 所以我不知道代码,但是,如果有人可以帮我,我确实需要帮助...


我有一个项目要求我将4个工作日(节假日除外)添加到许多员工条目的开始日期。


Excel中的Workday公式非常适合我需要的东西,但是如何让它在Access 2003中运行?

解决方案

< blockquote> Sabrina ,Microsoft Access中不存在此功能作为内部函数。当我有机会,或者除非其他人自己提供答案,我将为您创建一个自定义函数,用于计算开始日期的工作日数(加或减)。当然,周末和假日将被排除在外。这是你在找什么?


ADezii,如果你有机会为我创建一个自定义函数,我会非常棒。


我真正需要的是能够输入开始日期,在该日期添加4天,结果是计算的结束日期减去周末和假日。


还有一些条目需要在另一个开始日期添加2天(跟踪另一种类别)。


你可以做些什么来帮助我会很棒!谢谢!


这是Sabrina。我为您创建了一个自定义函数,允许您将任意工作天数添加到开始日期。工作日将被定义为非周末的任何一天,也不是由名为tblHolidays的表中的预先指定的日期定义的假日。我认为没有必要使事情复杂化并在开始日期之前允许日期。请仔细按照下面列出的说明进行操作,如果您仍有问题,请告诉我。

  1. 创建一个名为tblHolidays的表。此表将包含一个名为Holiday的单个字段,它将是一个日期/时间数据类型,并且将成为主键。
  2. 使用假期列表或任何日期填充此表。您不希望将其指定为工作日。下面是tblHoliday和我使用的一些示例日期:

    展开 | 选择 | Wrap | 行号


I am not a programmer - so I don''t know code, however, I do need some help if anyone can oblige me...

I have a project that requires me to add 4 workdays (excluding holidays) to a beginning date for numerous employee entries.

The Workday formula in Excel is perfect for what I need, but how can I make it work in Access 2003?

解决方案

Sabrina, this functionality does not exist in Microsoft Access as an Intrinsic Function. When I get a chance, or unless someone else provides an answer themselves, I''ll create a Custom Function for you that will calculate the Number of Workdays, either plus or minus, from a Start Date. Weekends and Holidays would be excluded, of course. Is this what you are looking for?


ADezii, I would be MOST GREATFUL if you could creat a Custom Function for me when you get a chance.

What I really need is to be able to type in a beginning date, add 4 days to that date with the results being an end date calculated minus weekends and holidays.

There will also be some entries that will need to have 2 days added to another beginning date (tracking another kind of category).

Anything you can do to help me would be wonderful! Thank you!


Here it is, Sabrina. I created a Custom Function for you that you allow you to add any Number of Work Days to a Start Date. A Work Day would be defined as any Day that is NOT a Weekend and is also NOT a Holiday as defined by pre-assigned Dates in a Table named tblHolidays. I saw no need to complicate matter and allow for Dates prior to a Start Date. Follow the instructions outlined below carefully, if you are still having problems, let me know.

  1. Create a Table named tblHolidays. This Table will consist of a Single Field named Holiday, it will be a Date/Time Data Type, and will be the Primary Key.
  2. Populate this Table with a list of Holidays, or any Day for that matter that you would not wish to designate as a Workday. Below is tblHoliday with some sample Dates that I used:

    Expand|Select|Wrap|Line Numbers


这篇关于如何为Access 2003转换Excel公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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