How do I create custom fields to add subtract time

D

Dan

I'm trying to create an employee time sheet and I cannot figure out how to
program custom fields to add up the hours worked for the day and subtract the
lunch hour. I'm using the following fields. MondayIn, MondayLunch,
MondayOut and MondayHours.

Regards,
 
S

Sue Mosher [MVP-Outlook]

You'll need to provide more information about those fields -- specifically what type of properties they are -- date/time, numeric, text, etc.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
D

Dan

Thanks for the response. These fields are all date/time fields. I have no
problems recreating the fields if the properties are not correct. I just
need some guidelines as to what type of properties I should be using and how
to add up the hours worked for the day and subtract the lunch hour.

Your help is greatly appreciated.

Dan
 
S

Sue Mosher [MVP-Outlook]

You need to be using the DateDiff() function, which you'll find among the list of functions in the formula editor. The version in the formula editor works just like the VBScript version -- see http://msdn.microsoft.com/library/en-us/script56/html/vsfctdatediff.asp. For example, this formula returns the number of minutes between two date/time fields:

DateDiff("n", [MondayIn], [MondayOut])

Divide by 60 to get the number of hours.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


s
 
D

Dan

Thanks Sue, that was it.

Regards,

Dan

Sue Mosher said:
You need to be using the DateDiff() function, which you'll find among the list of functions in the formula editor. The version in the formula editor works just like the VBScript version -- see http://msdn.microsoft.com/library/en-us/script56/html/vsfctdatediff.asp. For example, this formula returns the number of minutes between two date/time fields:

DateDiff("n", [MondayIn], [MondayOut])

Divide by 60 to get the number of hours.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


s
Dan said:
Thanks for the response. These fields are all date/time fields. I have no
problems recreating the fields if the properties are not correct. I just
need some guidelines as to what type of properties I should be using and how
to add up the hours worked for the day and subtract the lunch hour.

Your help is greatly appreciated.

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top