working with date function

working with date function

Post by krik » Thu, 26 Jul 2001 21:29:47



Hi,

in a OL form, I have 2 hour fields and I have a third
field of the same type in which I'd like to put
automatically the difference between the 2 hour fields.

can someone give me a vba code form this field.
thank you.

 
 
 

working with date function

Post by Ken Slovak - [MVP - Outlook » Fri, 27 Jul 2001 04:38:26


    Hour3 = DateDiff("h", Hour1, Hour2)

If Hour1 is later than Hour2 then write it this way or you will get a
negative result:
    Hour3 = DateDiff("h", Hour2, Hour2)

--
Ken Slovak
[MVP - Outlook]
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
Appendices, Sams


Quote:> Hi,

> in a OL form, I have 2 hour fields and I have a third
> field of the same type in which I'd like to put
> automatically the difference between the 2 hour fields.

> can someone give me a vba code form this field.
> thank you.