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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Total Problem

Status
Not open for further replies.

topdesk123

Programmer
Sep 27, 2001
76
US
Good morning,

I use the following function for calculating regular time and over time in time cards:

RunTot: (DSum("acttime","time card hours","[TimeCardDetailID]<=" & [TimeCardDetailID] & "And [timecardid] = " & [timecardid] & ""))

"ACTTIME" is actually time elapsed.

My problem is, when someone is entering time card information and forgets to enter times for a previous day, the running total does not adjust correctly. Example:

Time
Card
Detail
ID DateWorked WorkStart WorkFinish ActTime RunTot
1167 6/1/2005 1:00:00 PM 3:00:00 PM 2.00 9
1166 6/1/2005 6:30:00 AM 1:00:00 PM 6.50 7
1165 6/1/2005 6:00:00 AM 6:30:00 AM 0.50 0.5
1171 6/2/2005 1:00:00 PM 3:00:00 PM 2.00 18.5
1169 6/2/2005 6:30:00 AM 1:00:00 PM 6.50 16
1168 6/2/2005 6:00:00 AM 6:30:00 AM 0.50 9.5
1170 6/3/2005 6:00:00 AM 6:30:00 AM 0.50 16.5

Obviously, the last amount in the RunTot column should be 18.5.

I would really appreciate anybody's help on this - it's driving me mad!!

TIA.
topdesk
 
And this ?
RunTot: DSum("acttime","time card hours","(DateWorked+WorkStart)<=" & [DateWorked]+[WorkStart] & " And timecardid=" & [timecardid])


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,

Thank you for your quick response. I get the following error message: Syntax error (missing operator)in query expression '(DateWorked+WorkStart)<=And timecardid = 75'.

I also have been trying to incorporate the dates to no avail.
 
If this is your error:

'(DateWorked+WorkStart)<=And timecardid = 75'

and this is the part of the expression that it corresponds to:

","(DateWorked+WorkStart)<=" & [DateWorked]+[WorkStart] & " And timecardid=" & [timecardid])

the bolded section (your fields) appears to have no values because there is nothing there in the expression to be evaluated.


'(DateWorked+WorkStart)<=[DateWorked]+[WorkStart] And timecardid = 75'


Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top