Difference Between Two Number Fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nsymiakakis
    New Member
    • Apr 2007
    • 31

    Difference Between Two Number Fields

    Hi All,
    I need to create a query that will look at two fields containing numbers, and give me the difference between the two. I have found alot of info for comparing two dates, but not simple numbers.
    The two fields are "Minutes Booked" and "Actual Minutes Used"
    Just an insight, this is for a surgeon booking an operating room, and how long they were actually in there, both in minutes as a whole number.
    i.e. Minutes Booked: 30
    Actual Minutes Used: 20
    the difference would be +10 minutes.
    and if the numbers were reversed, the difference would be -10 minutes.
    I would greatly appreciate any help you can give.
    Thank you in advance.
  • DonRayner
    Recognized Expert Contributor
    • Sep 2008
    • 489

    #2
    In query builder
    Code:
    TimeDiff: [Minutes Booked] -  [Actual Minutes Used]
    Where TimeDiff is whatever name you want and the other two are the actual names of your fields in the table.

    Or you can do the calculation directly on your report or form by setting the control source to of an unbound text box to
    Code:
    =[Minutes Booked] -  [Actual Minutes Used]
    Using the actual names of the controls on the form/report.

    Comment

    • nsymiakakis
      New Member
      • Apr 2007
      • 31

      #3
      Worked Perfectly

      You know, sometimes things are so simple, that you tend to overthink it.
      Thanks for your help, it worked great.



      Originally posted by DonRayner
      In query builder
      Code:
      TimeDiff: [Minutes Booked] -  [Actual Minutes Used]
      Where TimeDiff is whatever name you want and the other two are the actual names of your fields in the table.

      Or you can do the calculation directly on your report or form by setting the control source to of an unbound text box to
      Code:
      =[Minutes Booked] -  [Actual Minutes Used]
      Using the actual names of the controls on the form/report.

      Comment

      • DonRayner
        Recognized Expert Contributor
        • Sep 2008
        • 489

        #4
        Glad I could help, and we all have days like that ;)

        Comment

        Working...