My Assistant
![]() ![]() |
|
|
Mar 15 2012, 11:35 AM
Post
#21
|
|
|
UtterAccess VIP Posts: 8,109 From: CT |
that isnt what I meant. I didnt say to use the textbox name, I meant actually copy the entire string that you used.
you will have to check to make sure i got the right amount of closed parens =iff(Sum((NZ([Stop Time],0)-NZ([Start Time],0)-((NZ([Meal 1 In],0)-NZ([Meal 1 Out],0))+(NZ([Meal 2 In],0)-NZ([Meal 2 Out],0))))),>40,40,Sum((NZ([Stop Time],0)-NZ([Start Time],0)-((NZ([Meal 1 In],0)-NZ([Meal 1 Out],0))+(NZ([Meal 2 In],0)-NZ([Meal 2 Out],0))))) |
|
|
|
Mar 15 2012, 12:45 PM
Post
#22
|
|
|
UtterAccess Enthusiast Posts: 60 From: Mississippi |
Tried that too, same problem. I am attaching the DB to hopefully answer more questions. Select the employee with OT and open Report 1. I added two text boxes, the first returns 1 if over 40, otherwise 2. The second is the complete formula. Looking at the first textbox, it returns 2, the second result is 1.973611111. TotalHours is 47:22.
TC.zip ( 296.42K )
Number of downloads: 2 |
|
|
|
Mar 15 2012, 12:48 PM
Post
#23
|
|
|
UtterAccess VIP Posts: 8,109 From: CT |
I do not have 2010 so I have reached the limit of being able to help.
|
|
|
|
Mar 15 2012, 12:49 PM
Post
#24
|
|
|
UtterAccess Enthusiast Posts: 60 From: Mississippi |
It's 2007
|
|
|
|
Mar 15 2012, 01:10 PM
Post
#25
|
|
|
UtterAccess VIP Posts: 6,170 From: Bethesda, MD USA |
Gentlemen,
What "seems" to be the problem is in the formula, you are saying greater then the standard number 40 and your are comparing it to a value in HoursMinutes. You understand? What to do, I don't know...Yet. RAZMaddaz |
|
|
|
Mar 15 2012, 01:21 PM
Post
#26
|
|
|
UtterAccess VIP Posts: 6,170 From: Bethesda, MD USA |
Change your formula to the following:
=IIf(Sum((NZ([Stop Time],0)-NZ([Start Time],0)-((NZ([Meal 1 In],0)-NZ([Meal 1 Out],0))+(NZ([Meal 2 In],0)-NZ([Meal 2 Out],0)))))>Hour(40),1,2) Notice the Hour function I used. RAZMaddaz Here is a copy of your dbase with the change made. This post has been edited by RAZMaddaz: Mar 15 2012, 01:24 PM
Attached File(s)
|
|
|
|
Mar 15 2012, 01:45 PM
Post
#27
|
|
|
UtterAccess Enthusiast Posts: 60 From: Mississippi |
Brilliant. I renamed the textbox CheckOT that has the 1 or 2 in it. Now i have a problem with OT textbox.
=IIf([CheckOT]=1,[TotalTime]-Hour(40),Null) and =IIf([CheckOT]=1,HoursMinutes(Sum((NZ([Stop Time],0)-NZ([Start Time],0)-((NZ([Meal 1 In],0)-NZ([Meal 1 Out],0))+(NZ([Meal 2 In],0)-NZ([Meal 2 Out],0))))))-Hour(40),Null) Tried with and without the Hour, gives me a #Error. |
|
|
|
Mar 15 2012, 01:53 PM
Post
#28
|
|
|
UtterAccess VIP Posts: 6,170 From: Bethesda, MD USA |
Where is this OT textbox? Is this the Text Box named Text106, which is under the other text box in the Report Footer?
|
|
|
|
Mar 15 2012, 02:26 PM
Post
#29
|
|
|
UtterAccess Enthusiast Posts: 60 From: Mississippi |
TC.zip ( 299.24K )
Number of downloads: 3Also, had to use "40:00" to get the text106 box to display 40:00 |
|
|
|
Mar 15 2012, 03:12 PM
Post
#30
|
|
|
UtterAccess Enthusiast Posts: 60 From: Mississippi |
Does not matter which employee I choose, result on the iif formula is always 1.
|
|
|
|
Mar 15 2012, 03:23 PM
Post
#31
|
|
|
UtterAccess VIP Posts: 6,170 From: Bethesda, MD USA |
Sorry, I'm an idiot and didn't try the other Employees. Use the following instead:
=IIf(Sum((NZ([Stop Time],0)-NZ([Start Time],0)-((NZ([Meal 1 In],0)-NZ([Meal 1 Out],0))+(NZ([Meal 2 In],0)-NZ([Meal 2 Out],0)))))>TimeSerial(40,0,0),1,2) |
|
|
|
Mar 15 2012, 03:49 PM
Post
#32
|
|
|
UtterAccess Enthusiast Posts: 60 From: Mississippi |
Got the 40:00 to show if in Overtime, otherwise it shows TotalTime. I named the textbox RegTime
=IIf([TotalTime]>TimeSerial(40,0,0),HoursMinutes(TimeSerial(40,0,0)),[TotalTime]) Still can't get OT to work. =[RegTime]-[TotalTime] gives me #Error btw, nowhere near idiot level. I would have never thought of TimeSerial |
|
|
|
Mar 15 2012, 04:10 PM
Post
#33
|
|
|
UtterAccess VIP Posts: 6,170 From: Bethesda, MD USA |
If you enter the following:
=IIf([TotalTime]>[CheckOT],1,2) This should work, then change the one and two to either Text Box name. FYI, I need to go now, we can work on this tomorrow. RAZMaddaz |
|
|
|
Mar 16 2012, 09:12 AM
Post
#34
|
|
|
UtterAccess Enthusiast Posts: 60 From: Mississippi |
Alringt, I have a textbox that will stop at 40:00, [RegTime].
Tried =HoursMinutes(TimeSerial([TotalTime],0,0))-HoursMinutes(TimeSerial([RegTime],0,0)) =TimeSerial([TotalTime],0,0)-TimeSerial([RegTime],0,0) =HoursMinutes([TotalTime])-HoursMinutes([RegTime]) =[TotalTime]-[RegTime] All #Error [TotalTime] =HoursMinutes(Sum((NZ([Stop Time],0)-NZ([Start Time],0)-((NZ([Meal 1 In],0)-NZ([Meal 1 Out],0))+(NZ([Meal 2 In],0)-NZ([Meal 2 Out],0)))))) [RegTime] =IIf([TotalTime]>TimeSerial(40,0,0),HoursMinutes(TimeSerial(40,0,0)),[TotalTime]) |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 20th May 2013 - 07:31 AM |