以连续形式计算总时间 [英] calculate grand total time in continuous forms

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

问题描述

我需要帮助以连续形式制作总时间。

计算我使用以下公式的总工作时间

=格式([timeout] + 1- [ timein] -nz([午餐]);短时间)。

但是当我在表单页脚(对于所有记录)中花费总时间时,我的结果是错误的。

我的总计必须采用格式[hh:mm]。

谢谢,

解决方案


=格式([超时] + 1- [时间] -nz([午餐]) ; 短时间)



你能为我检查一下吗?我不确定,但我认为分号应该是逗号。


Format()函数返回一个字符串值。

它没有''重要的是字符串中的字符看起来可能是一个数字 - 访问不被愚弄。

你不能对字符串执行任何类型的算术。

而不是使用Format()函数,请尝试使用TextBox的Format属性。



我需要帮助以连续形式计算总时间。

计算我使用以下公式的总工作时间

=格式([timeout] + 1- [timein] -nz([午餐]);短时间)。

但是当我在表单页脚(对于所有记录)中总计大部分时间时,我的结果是错误的。

我的总计必须采用格式[hh:mm]。

谢谢,



使用此公式给出以下值

=格式(([超时] + 1 - [时间in - - nz([午餐],0),短时间)。


''如果午餐是一小时

=格式(( #6:12:00 PM#+ 1) - (#9:25:00 AM#) - Nz(#1:00:00 AM#,0),短时间)

结果:07:47:00


''如果午餐是空值

=格式((#6:12:00 PM#+ 1 ) - (#9:25:00 AM#) - Nz(Null,0),短时间)

结果:08:47:00

< b> 现在在页脚中加总:


这很复杂。


首先页脚中需要两个文本框。一个用于保存称为calcTime的时间总和(设置为可见否),另一个用于显示名为txtTotalTime的结果。暂时不要将它们中的任何一个设置为任何东西。这必须使用VBA代码完成。


接下来你需要将以下函数放在一个模块中。

展开 | 选择 | Wrap | 行号

I need help to make grand total time in continuous forms.
to calculate total work time I use following formula
=format([timeout]+1-[timein]-nz([lunch]);"short time").
but when I make grand total time in form footer (for all records) my result is error.
My grand total must be in format [hh:mm].
thanks,

解决方案

=format([timeout]+1-[timein]-nz([lunch]) ; "short time")

Can you just check something for me? I''m not certain, but I think the semicolon should be a comma.


The Format() function returns a string value.
It doesn''t matter that the characters in the string look like it may be a number - Access is not fooled.
You can''t perform arithmetic of any sort on a string.

Rather than using the Format() function, try using the Format property of the TextBox instead.


I need help to make grand total time in continuous forms.
to calculate total work time I use following formula
=format([timeout]+1-[timein]-nz([lunch]);"short time").
but when I make grand total time in form footer (for all records) my result is error.
My grand total must be in format [hh:mm].
thanks,

Using this formula given the values below
= Format(([timeout] + 1 - [timein] - nz([lunch],0), "short time").

''if lunch is one hour
= Format((#6:12:00 PM# + 1) - (#9:25:00 AM#) - Nz(#1:00:00 AM#, 0), "short time")
Result: 07:47:00

''if lunch is a null value
= Format((#6:12:00 PM# + 1) - (#9:25:00 AM#) - Nz(Null, 0), "short time")
Result: 08:47:00

Now to sum in the footer:

This is quite complicated.

Firstly you will need two textboxes in the footer. One to hold the sum of time called calcTime (set visible to "No") and the other to display the result called txtTotalTime. Don''t set either of them to anything for the moment. This will have to be done using VBA code.

Next you need to put the following function in a module.

Expand|Select|Wrap|Line Numbers


这篇关于以连续形式计算总时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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