Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Location
    Maine
    Posts
    49
    Provided Answers: 3

    Question Unanswered: Converting data types

    I have a field called Labor Hours. It's data type is Date/Time and formatted for Short Time. If I have a time of 1:15 to the user is 1 hour and 15 min. I need to convert this to a Number type and Decimal. I want it to convert to 1.25. Does anybody have any suggestions on how to do this?

    Thanks
    Pat Dalton

  2. #2
    Join Date
    Aug 2002
    Location
    Québec, Canada
    Posts
    109
    Here is snippet of code:

    Code:
        Dim myDate As Date
        Dim dblTime As Double
        
        'Let's try with 1 hour and 15 minutes
        myDate = #1:15:00 AM#
    
        dblTime = Hour(myDate) + Minute(myDate) / 60
    JefB

Posting Permissions

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