How do I create custom fields to add subtract time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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,
 
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
 
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
 
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
 
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
 
Back
Top