访问减法时间 [英] Access subtract time

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

问题描述

如何在Access表中减去两次?

How can I subtract two times in an Access table?

查询必须自动执行。我需要在到达时减去剩余的时间,所以我得到工作时间:

query must do it automatically. I need to subtract left time with arrived, so then I get hours of working employed:

查询必须在表中填写小时列,所以我可以在c#程序中获得。

Query must fill hours column in table, so I can get it in c# program.


[Left] - [Arrived]

[Left]- [Arrived]

推荐答案

在访问中,如果这些字段是日期/时间类型,那么简单的是将它们减法并根据需要格式化输出。减数导致天数和天数。如果你想在几个小时内,只需乘以24,这给你,小时和小时的小时。

In access, if the fields are date/time type, it is as simple as substract them and format output as desired. The substraction results in days and fraction of days. If you want it in hours, just multiply by 24, which gives you, hours and fracition of hours

SELECT cdbl([Left] - [Arrived]) * 24 as worked_hours FROM yourtable

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

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