Ms访问时间计算。 [英] Ms Access Time Calculations.

查看:109
本文介绍了Ms访问时间计算。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我是新会员,我很高兴参与此论坛的一部分。


我面临一个小问题在MS访问中进行时间计算。我为我的工人准备了一张时间表。他们的常规时间是17:00,超过加班时间。我使用公式DateDiff(n,[常规时间],[超时])/ 60。如果工人在工作结束前完成工作,我可以计算加班时间。但是,如果他一直工作到例如凌晨2点(即9小时),我会得到负面结果。


可以解决这个问题。


非常感谢提前

解决方案

您已(意外)在访问文章部分中发布了此问题。这不是一篇文章。

我正在把它移到主要的Access问题论坛。


版主。


< blockquote>


您好,


我是新会员,很高兴参与此论坛的一部分。

在MS访问中进行时间计算时,我遇到了一个小问题。我为我的工人准备了一张时间表。他们的常规时间是17:00,超过加班时间。我使用公式DateDiff(n,[常规时间],[超时])/ 60。如果工人在工作结束前完成工作,我可以计算加班时间。但是,如果他一直工作到例如凌晨2点(即9小时),我会得到负面结果。


可以解决这个问题。


非常感谢



使用Mod运算符。这需要确保在处理时确保值是整数但不应该是一个太大的问题。

你正在使用的单位是什么(IE。有什么价值1 mean)?


尝试将Time字段更改为Date& Time字段,例如使用Now()函数记录时间和超时。


由于Access存储和计算时间的方式,日期/时间函数可能很棘手,但实际上这应该是计算所需差异的简单方法。


问候,

Scott


Hello,

I am a new member and am glad to a part of this forum.

I am facing a slight problem while doing time calculations in MS access. I ve prepared a time sheet for my workers. Their regular time is till 17:00 hrs and anything above that is overtime. I am using the formula DateDiff("n",[Regular Time],[Time Out])/60. I am able to calculate the overtime if the worker finishes his work before the day ends. However , if he works untill for eg 2:00 AM , (i.e 9 hrs of over time) , i get a negative result.

Can this be worked out .

Thanks much in advance

解决方案

You have (accidentally) posted this question in the Access Articles section. This is NOT an article.
I''m moving this to the main Access questions forum.

MODERATOR.


Hello,

I am a new member and am glad to a part of this forum.

I am facing a slight problem while doing time calculations in MS access. I ve prepared a time sheet for my workers. Their regular time is till 17:00 hrs and anything above that is overtime. I am using the formula DateDiff("n",[Regular Time],[Time Out])/60. I am able to calculate the overtime if the worker finishes his work before the day ends. However , if he works untill for eg 2:00 AM , (i.e 9 hrs of over time) , i get a negative result.

Can this be worked out .

Thanks much in advance

Use the Mod operator. This will require ensuring that the value is an integer when processed but shouldn''t be too much of a problem.
What are the units you''re working in (IE. What does a value of 1 mean)?


Try changing your Time fields to Date&Time fields, such as by using the Now() function for logging the time in and time out.

Date/Time functions can be tricky because of the way Access stores and calculates time, but this should actually be a simple way to calculate the difference you are looking for.

Regards,
Scott


这篇关于Ms访问时间计算。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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