Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2008
    Posts
    17

    Unanswered: [SOLVED] Use a query to subtract two fields

    I am new to access and having trouble working out how to do this.

    I have two separate fields (from the same table), each with scores from 1-6.

    Eg

    InitialScore FollowScore
    1 4
    3 5
    3 2

    etc. I am trying to work out an SQL query that will subtract the forst from the second:

    ie Change = FollowScore - InitialScore

    But my syntax is wrong. Is there a SUBTRACT function (like 'Sum') - I've tried this without success

    Should it look something like??
    Code:
    SELECT Subtract(Demographics.FollowGrade-Demographics.InitialGrade) AS [Change], 
    FROM Demographics
    Thanks for any help.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    If they're both numeric values of the same data type...
    Code:
    SELECT number1 - number2 As [Change]
    ...
    George
    Home | Blog

  3. #3
    Join Date
    Apr 2008
    Posts
    17
    Thank you. Works perfectly.

Posting Permissions

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