Results 1 to 3 of 3

Thread: Caclulation

  1. #1
    Guest

    1.5 * 3.5 hours

    I got my program to recognise that the time is or is not pass 5:00PM. The only thing I need to get to work now is the calculation below the IF statement. The If does work corectly.

    Const OTLimit As Date = #5:00:00 PM#
    Const OTCost As Integer = 1.5

    If EndTime > OTLimit Then
    OT = (EndTime - OTLimit)
    OT = (OT * OTCost)
    lblTotalHours.Caption = OT
    End If

    Thanks

    Ken Devorak

  2. #2
    Addicted Member
    Join Date
    Jul 1999
    Location
    Portland, OR.
    Posts
    226

    Exclamation

    Hi Kenny_Dee,

    Const OTCost As Integer = 1.5

    Hint: Do you see 1.5 as an integer ?

    Good luck.


  3. #3
    Addicted Member jcouture100's Avatar
    Join Date
    Aug 1999
    Posts
    141

    Smile

    Hi Kenny_Dee,

    Lyla is right, an integer can't have a decimal point. You'll need to Dim it as a Single (or Double).

    Also, I'm assuming you know the code you posted isn't complete. I'm guessing that you set the value of
    EndTime somewhere and just didn't list it in the code you posted.

    Good luck.

    JC.
    JC

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width