Math functions in a Query

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

How do you add and subtract numbers in a query field?
I want to subtract 2 numbers in two seperate fields in a
query and have them show the diff in a third field ? I
need this to happen in a query
Thanks Bill
 
In your query in the the field row of the column you want
to use you would do

Num3:[Num1]-[Num2]

Num1 and Num2 being the names of the fields you want to
subtract.
 
How do you do times in a query? Ineed to subtract Start
Time from End Time.
-----Original Message-----
In your query in the the field row of the column you want
to use you would do

Num3:[Num1]-[Num2]

Num1 and Num2 being the names of the fields you want to
subtract.
-----Original Message-----
How do you add and subtract numbers in a query field?
I want to subtract 2 numbers in two seperate fields in a
query and have them show the diff in a third field ? I
need this to happen in a query
Thanks Bill
.
.
 
If you're running from within Access, you can use the DateDiff function. Or,
if you prefer, you can simply subtract one from the other: date/times are
stored as 8 byte floating point numbers, where the integer part is the
number of days relative to 30 Dec, 1899 and the decimal part is the time as
a fraction of a day. You'll need to multiply by the appropriate number (24
to convert to hours, 1440 to convert to minutes, 86400 to convert to
seconds)

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



MIke Madden said:
How do you do times in a query? Ineed to subtract Start
Time from End Time.
-----Original Message-----
In your query in the the field row of the column you want
to use you would do

Num3:[Num1]-[Num2]

Num1 and Num2 being the names of the fields you want to
subtract.
-----Original Message-----
How do you add and subtract numbers in a query field?
I want to subtract 2 numbers in two seperate fields in a
query and have them show the diff in a third field ? I
need this to happen in a query
Thanks Bill
.
.
 
Back
Top