在Access中计算结束日期(工作日) [英] Calculate end date (working day) in Access

查看:205
本文介绍了在Access中计算结束日期(工作日)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我设置一个任务表,其中包含任务开始日期和完成任务的天数(如在MS Project中),如何计算结束日期字段并将其放在表中,忽略周末(即只考虑周一到周五)

真的很烦我,有人可以帮帮忙吗?

解决方案

在表格中创建字段,让我们调用它endDate


你需要在一个模块中创建一个函数来处理如下的天数

展开 | 选择 | Wrap | 行号


在表格中创建字段,我们称之为endDate


您需要在模块中创建一个函数处理如下的天数

展开 | 选择 | Wrap | 行号


抱歉我的逻辑错了。以下函数将返回由任意给定工作日数表示的实际天数的计数。然后可以将此数字添加到开始日期以获得结束日期(请参阅代码下方的更新功能)。我已经测试了它,似乎工作正常,试试看。

展开 | 选择 | Wrap | 行号


If I set up a task table with a task start date and a number of days to complete the task (as in MS Project), how can I calculate an end date field and place it in the table, ignoring weekends (i.e. only considering Monday to Friday)
Really bugging me, can someone help please?

解决方案

Create the field in the table, lets call it endDate

You will need to create a function in a module to handle the count of days as below

Expand|Select|Wrap|Line Numbers


Create the field in the table, lets call it endDate

You will need to create a function in a module to handle the count of days as below

Expand|Select|Wrap|Line Numbers


Sorry my logic was wrong. The following function will return a count of the actual no of days represented by any given number of working days. This number can then be added to the start date to get an end date (see update function below code). I''ve tested it and it seems to work fine, try it and see.

Expand|Select|Wrap|Line Numbers


这篇关于在Access中计算结束日期(工作日)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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