Results 1 to 5 of 5
  1. #1
    jonken is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    2

    syntax errors when tryng to use results of a sum query in second calcualtion

    Looking for some assistance as an access beginner - I have set up a query which sums the results of a calculation in a table. In the same query I then want to apply a second calaculation to those sum results. This is a risk management database - where I have table which calculates the impacts of actions taken to mitigate a risk - the sum query adds up those risk mitgation results and produces those in the query perfectly - the output is a value between 0 and 1 to two decimal places. Also in the query I capture the orginal risk score prior to mitgation from another linke tabe. The third step I want to do is basically calcualte a revised risk score once the rawrisk score is discounted by the impact of the risk mitigtions - the formula should be [rawriskscore]*(1-[sumofmitgationresults]) - however i keep getting a synta error or asked for parameter values whenever i run the query with this calculation column added. Can anyone advise why this happening as the data is there and the formula looks sound, and I am using querybuilder to build the forumla so not getting any of the field names wrong.



    thanks for any assistace

    jon

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    you can get errors if any value is NULL.

  3. #3
    knarfreppep is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Location
    Adelaide, Australia
    Posts
    106
    Have you thought about doing one thing at a time? e.g. -

    MyQuery
    MyQuery01
    MyQuery02

    where MyQuery01 does the first step, MyQuery02 works on MyQuery01's results, and MyQuery works on MyQuery02's results to render the final result.

  4. #4
    knarfreppep is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Location
    Adelaide, Australia
    Posts
    106
    Any you can often speed things up with something a lot more complicated than this simple example -

    MyQuery
    MyQuery01
    MyQuery02
    MyTable

    where MyQuery01 does the first step, MyQuery02 works on MyQuery01's results and 'makes' MyTable, and MyQuery works on MyTable to render the final result.

  5. #5
    jonken is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    2
    Thanks I broke it down into steps like you suggested and the whole calaculation is now working perfectly.
    Thanks for taking the time, I appreciate it.


    Quote Originally Posted by knarfreppep View Post
    Any you can often speed things up with something a lot more complicated than this simple example -

    MyQuery
    MyQuery01
    MyQuery02
    MyTable

    where MyQuery01 does the first step, MyQuery02 works on MyQuery01's results and 'makes' MyTable, and MyQuery works on MyTable to render the final result.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to correct #Num! errors in a query
    By accessmatt in forum Queries
    Replies: 10
    Last Post: 09-29-2014, 10:52 AM
  2. Replies: 4
    Last Post: 06-21-2014, 05:43 AM
  3. Query by form errors
    By cfljanet in forum Access
    Replies: 9
    Last Post: 09-25-2013, 11:17 AM
  4. VBA Code to report syntax errors via email
    By jazzkenney in forum Programming
    Replies: 6
    Last Post: 11-30-2011, 08:54 PM
  5. Replies: 13
    Last Post: 01-13-2011, 10:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums