Hi Dan,
I may be taking a completely wrong approach here, which may be why Amy's
suggestion didn't work.
What I want is a small app that will take in start and end hours on a daily
basis; then after two weeks, calculate total hours worked, gross and net
earnings, etc.
BTW, I looked everywhere I knew to look for a template for this, but to no
avail. If you know of one, please point the way!
On one record I have:
1MonIn; 1MonOut; 1TueIn; 1TueOut; 1WedIn; 1WedOut; Etc.
These are all Date/Time formats
Then, in the underlying query i have an expression like below for each
workday:
MondayTotal: DateDiff("n",[1MonIn],[1MonOut])\60 & ":" &
DateDiff("n",[1MonIn],[1MonOut]) Mod 60
So when I input start and stop times (i.e: If I put 10:00 AM in 1MonIn and
3:00 PM in 1MonOut) I get 5:0 in the MondayTotal.
Now I want to add up all the daily hours, hence my original post. I either
got #Error, #Name or 5:05:05:05:05:05:0 etc
Dan Artuso said:
Hi,
What are the values like? An integer can only handle up to 32,000
Would any of the additions exceed that? If so, use CLng to convert to
a long integer.
HTH
Dan Artuso, MVP
Hi Amy,
Both of the following methods produce #Error:
=CInt([Field1])+CInt([Field2]) (in the controlsource of the textbox)
and
expression: CInt([Field1])+CInt([Field2]) (as an added field in the query)
What am I doing wrong?
TIA,
Jake
Amy Vargo said:
Hi,
My name is Amy Vargo. Thank you for using the Microsoft Access Newsgroups.
It sounds like you are adding fields that are of the Text data type, not
number. Try wrapping the field name with the CInt() function, Convert to
Integer. For example:
expression: CInt([Field1])+CInt([Field2])
I hope this helps! If you have additional questions on this topic, please
respond back to this posting.
Regards,
Amy Vargo
Microsoft Access Engineer
This posting is provided 'AS IS' with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.