OT计算 [英] OT Calculation
问题描述
我在报告中为小型工资单系统计算OT有问题;
当一名员工在假期工作时他有资格获得双倍加班费。所以我有tblholidays和其他相关的表
i尝试了下面的论点
如果不是IsNull(DLookup(" [Hol_id] "," tblHolidays"," [Hol_Date] =#"& WORK_DATE&"#"))然后
otpay = [OT_HRS] * [HR_RATE] * [DOT_RATE ]
Else
otpay = [OT_HRS] * [HR_RATE] * [OT_RATE]
结束如果
结束Sub
如何将其置于访问自定义功能中?帮助赞赏
i''ve got a problem for calculating OT in the report for a small payroll system;
when an employee worked on a holiday he''s qualified for double overtime. so i''ve got tblholidays and other related tables
i tried the follwing argument
If Not IsNull(DLookup("[Hol_id]", "tblHolidays", "[Hol_Date] = #" & WORK_DATE & "#")) Then
otpay = [OT_HRS] * [HR_RATE] * [DOT_RATE]
Else
otpay = [OT_HRS] * [HR_RATE] * [OT_RATE]
End If
End Sub
how can i put this in a custom function in access? help appreciated
推荐答案
您可以将此代码放在模块中的函数中。但是,除非您将它们作为参数传递,否则我假设在表单上的值为
[OT_HRS],[HR_RATE],[DOT_RATE]和[OT_RATE]的值将无法使用。
例如假设[OT_HRS]的数据类型为Integer,WORK_DATE具有日期/时间数据类型,另一个是currancy。您可以尝试以下内容:
You can put this code in a function in a module. However, the values in
[OT_HRS], [HR_RATE], [DOT_RATE] and [OT_RATE] which I assume are on a form will not be available to the function unless you pass them in as parameters.
e.g. Assuming [OT_HRS] has a data type of Integer, WORK_DATE has a date/time data type and the other are currancy. You could try something like the following:
您可以将此代码放在模块中的函数中。但是,除非您将它们作为参数传递,否则我假设在表单上的值为
[OT_HRS],[HR_RATE],[DOT_RATE]和[OT_RATE]的值将无法使用。
例如假设[OT_HRS]的数据类型为Integer,WORK_DATE具有日期/时间数据类型,另一个是currancy。您可以尝试以下内容:
You can put this code in a function in a module. However, the values in
[OT_HRS], [HR_RATE], [DOT_RATE] and [OT_RATE] which I assume are on a form will not be available to the function unless you pass them in as parameters.
e.g. Assuming [OT_HRS] has a data type of Integer, WORK_DATE has a date/time data type and the other are currancy. You could try something like the following:
它有效,但似乎分数存在一些问题:
低于报告输出:
工作小时报告/ OT小时
员工编号#1 Per Hr。评价[P]
it works but it seems there are some problems in fractions:
given below the output of the report:
Report for Worked Hrs / OT Hrs.
Employee No# 1 Per Hr. Rate [P]
这篇关于OT计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!