• Oh no, not ‘time’ calcs again! (2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Oh no, not ‘time’ calcs again! (2000)

    Author
    Topic
    #379053

    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.

    Viewing 1 reply thread
    Author
    Replies
    • #629739

      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.

    • #629743

      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]

      • #629744

        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.

        • #629754

          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…

          • #629769

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

            • #629875

              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.

    Viewing 1 reply thread
    Reply To: Oh no, not ‘time’ calcs again! (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: