Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

about formula

Status
Not open for further replies.

seagate

Programmer
Joined
Sep 19, 2001
Messages
1
Location
AU
i have two tebles
one is Emp_Attendance and other is Over_Time

fields for Emp_Attendance
Comp_Code Company code
Dept_Code Department Code
Emp_Code Employee Code
Over_Time This field is contining
monthly OverTime hours from user

fields for Over_Time
Comp_Code
LowerBound
UpperBound
OverTimeAmount

First Record in Over_Time Teble
LowerBound =0
UpperBound =4
OverTimeAmount =30

Second Record in Over_Time Teble
LowerBound =5
UpperBound =9
OverTimeAmount =40

Thired Record in Over_Time Teble
LowerBound =10
UpperBound =15
OverTimeAmount =40

Now i Want Number which from user enter in Attend_Mast as Over_Time and it must be compair with Lower_Bound and Upper_Bound if valu of Over_Time in Attendance_Tebel is
5 then it must be check and give O.T. amunt as 5*40=200
pls tell me that how can i do it.
 
seagate: I think what you are asking for is a parameter which can be used by your user to enter the number of hours overtime and use that to select the appropriate record from your Over_Time table.

As you don't mention whether overtime is always entered as whole hours I've assumed that you will use a numeric parameter.

You will then need a formula as follows:

global numbervar ot_value:=0;
if {?param_ot} in {Over_Time.LowerBound} to {Over_Time.UpperBound} then
rate:= {?param_ot}*(Over_Time.OverTimeAmount}
else
ot_value:=ot_value

You'll then need another formula to reset ot_value to zero when EmpCode changes.

HTH David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top