哪一天是指定日期范围内的工作日 [英] Which days are work days in a given date range

查看:340
本文介绍了哪一天是指定日期范围内的工作日的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有内置的功能会告诉我哪些天是工作日?这就是我的意思,



如果我选择今天的日期(2011年6月14日),今天将提供我的检查号码。这个交付周期包括周末。所以如果我有一个客户在10日(星期五)开始一个项目,并完成它今天;它会显示花了大约五天,而不是三天。

解决方案

我相信以前在很久以前做过这样的功能,但我相信这个功能已经删除。我相信你应该能够使用以下计算两个日期之间的工作日期的内容:

  DateDiff(d ,{Orders.OrderDate},{Orders.ShipDate}) -  
DateDiff(ww,{Orders.OrderDate},{Orders.ShipDate},crSaturday) -
DateDiff(ww {Orders.OrderDate},{Orders.ShipDate},crSunday)

这得到总天数差异从总数中减去星期六和星期日。请注意,这不包括假期。为此,您需要在自己的用户函数库中维护它们,并将它们包含在计算中。



希望这有帮助。


Is there a built in function that will tell me which days are work days? this is what i mean,

If I were to choose today's date (6/14/2011), it will give me any inspection numbers clocked out today. This lead time includes weekends. So if I had a customer start a project on the 10th (Friday) and finish it today; it would show it took about five days, instead of three.

解决方案

I believe there used to be a function to do this a long long time ago, but I believe that function has since been removed. I believe that you should be able to use something like the following which calculates the business days between two dates:

DateDiff ("d", {Orders.OrderDate}, {Orders.ShipDate}) -
DateDiff ("ww", {Orders.OrderDate}, {Orders.ShipDate}, crSaturday) -
DateDiff ("ww", {Orders.OrderDate}, {Orders.ShipDate}, crSunday)

This gets the total days difference and subtracts the saturdays and sundays from the total. Note this does not include holidays. For that you'd need to maintain them in your own User Function Library and include them in the calculation.

Hope this helps.

这篇关于哪一天是指定日期范围内的工作日的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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