Results 1 to 7 of 7
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Oh no, not 'time' calcs again! (2000)

    I know Access has a few "issues" dealing with time, but there must be a way to do this. I have a new billing issue where I need to calculate total hours minus two hours with the result used as a multiplier for the hourly rate (dollars). Right now, the user enters the starting and ending time, and the balance is displayed in hh:mm. As the first two hours of time are not charged to the customer (that amount might vary between accounts) I need to have the balance returned as a whole number (to calculate the "time" * "dollars"). I managed to get the start time and end time text boxes to return the balance in a third text box, but I can't manage to return a whole number. It's been fun, but I'd really like to go home some time.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Oh no, not 'time' calcs again! (2000)

    Billinghours = [balance]* 24 -2

    If your current balance is displayed in hh:nn then it represents a decimal part of a day. Multiply by 24 will turn this into a number of hours , then take away the two that don't get charged for.
    Regards
    John



  4. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Oh no, not 'time' calcs again! (2000)

    That's waaaaay to simple John! Got anything more complicated?
    Thanks a bunch!! I'm outta here! (By the way...) As comp time (the 2 hrs) might vary between accounts, can I add another text box for the comp time?
    I tried the following, but got an error.

    Billinghours=[balance]*24-[comptime]
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  5. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Oh no, not 'time' calcs again! (2000)

    I have just been trying this and it works OK for me.

    Is [comptime] a time field or a normal number?

    If it is a time format then you need :

    Billinghours=24*([balance]-[comptime])

    Have a look at the attachment.
    Attached Files Attached Files
    Regards
    John



  6. #5
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Oh no, not 'time' calcs again! (2000)

    You did it John! It works great!
    Thanks again for all your help!
    If you ever make it to the colonies, I owe you a Fosters or two, or three, or...
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  7. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Oh no, not 'time' calcs again! (2000)

    Where do I have to go get a Fosters?
    I live near the hometown of Fosters.
    Regards
    John



  8. #7
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Oh no, not 'time' calcs again! (2000)

    Sorry I missed your last post, but I was on my way out the door.
    I'm in California and noticed that you were "down under". As a fan of Fosters, I made the offer if you ever were out this way.
    I'm a "newbie" to Access as far as doing any developement, but managed to "inherit" the Office XP Developers Version. Of course I don't even know what I've got yet, but I did manage to get up the gumption to buy a copy of Beginning VBA. I can't even remember how I found this site but I sure have enjoyed the exchanges and generous helps. There are some very compationate and helpful people here that put aside ego to assist those who are just trying to get started. That's pretty rare in any forum. You're a prime example of what I mean. What was probably a very simple matter to you had become a great source of frustration to me. It seems that MS sells their products with vague or limited documentation and just says "good luck". People are left staring at the screen with their finger poised over the mouse not wondering where they "want to go today", but rather how to get there. If not for friendly users, I'd never get to the first "click". When I say "thank you" for your help, it's really much bigger than the words can say.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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