adding time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jawbone
    New Member
    • Nov 2011
    • 14

    adding time

    hello everyone, i have a problem that is probably simple to you to figure out. im using access 07 and novice as hell. I recently created a database form so that i can calculate my non-revenue miles for this transportation service im employed, unfortuntaly those particular hour i dont get paid for. Anyway i created a simple time sheet using military time. example. clock in time 13:00 til 15:00 which is 2 hours worked, but how can i get access to do that. i created an query. the expression is Totalhours:[timeend]-[timestart]= still nothing. can someone help me pls.
  • patjones
    Recognized Expert Contributor
    • Jun 2007
    • 931

    #2
    Is the total hours calculation being done in another text box on the same form? Also, where exactly are you writing out the expression to do the subtraction? Generally, calculated controls need to have the expression put in the Control Source setting in the property sheet.

    Pat

    Comment

    • ADezii
      Recognized Expert Expert
      • Apr 2006
      • 8834

      #3
      Code:
      TotalHours:DateDiff("h",[TimeStart],[TimeEnd])

      Comment

      • jawbone
        New Member
        • Nov 2011
        • 14

        #4
        can i email you guys my dbf so you can see my problem, sorry im so dumbfounded.

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #5
          @jawbone:
          Attach you Database to another Post.

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32656

            #6
            How are [TimeEnd] and [TimeStart] defined? If they are both DateTime variables then what you have should already work. Why do you think it isn't? What are you seeing? We cannot help you unless you express the question clearly and keep us fully informed (as we can't see what you're doing - we rely on your question and explanation).

            Comment

            • jawbone
              New Member
              • Nov 2011
              • 14

              #7
              thanks NeoPa i change my datatype to DateTime instead of text and it calculated fine. Thanks for your time everyone.

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32656

                #8
                That would certainly explain it.

                You may want to select a post here as Best Answer before you go.

                Comment

                Working...