Re: Time over 24 hours
- From: Bob Quintal <rquintal@xxxxxxxxxxxx>
- Date: Mon, 27 Feb 2006 23:17:30 GMT
"Drum2001" <drum2001@xxxxxxxxx> wrote in
news:1141047864.477345.243400@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
What do I put where? If I put:[clockout])-
overtime = SecToDur(IIF(sum(datediff("s",[clockin],
40*60*60 >0, sum(datediff("s",[clockin],[clockout])-40*60*60,0))
function
In the query, it says "The Expression you entered has a
containing the wrong number of arguments."I parsed out your code, you are missing a parenthesis somewhere.
overtime =
SecToDur(
IIF(
sum(
datediff(
"s",[clockin],[clockout]
)
- 40*60*60 >0,
sum(
datediff(
"s",[clockin],[clockout]
)-40*60*60,0
)
)
1) in a query, you need a colon to define the column, instead of
an equals,
2) the nesting of parentheses can be a royal PITA. I oftem build
in notepad, tabbing in for each ( and out per ), to make sure
they're in the right places.
Overtime:
sectodur(
IIF(
sum(
datediff(
"s",[clockin],[clockout]
)
)-40*60*60 >0
,
sum(
datediff(
"s",[clockin],[clockout]
)
)-40*60-60
,
0
)
)
With this level of nested calls, I'd probably move the code to a
function.
--
Bob Quintal
PA is y I've altered my email address.
.
- Follow-Ups:
- Re: Time over 24 hours
- From: Drum2001
- Re: Time over 24 hours
- References:
- Time over 24 hours
- From: Drum2001
- Re: Time over 24 hours
- From: Wayne Morgan
- Re: Time over 24 hours
- From: Drum2001
- Re: Time over 24 hours
- From: Bob Quintal
- Re: Time over 24 hours
- From: Drum2001
- Time over 24 hours
- Prev by Date: Re: Any way to remove the AutoIncr / Autonum attribute using DAO?
- Next by Date: Re: drop list to fill in the blanks on a form
- Previous by thread: Re: Time over 24 hours
- Next by thread: Re: Time over 24 hours
- Index(es):
Relevant Pages
|