| | |
Perform a calculation in a query
Please support our MS Access and FileMaker Pro advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
i just did this for my coursework
in the Field: section under the queries design view you can tyupe things like this.
GPPerCentre: [num_candidates]*[payment_eachscript]
(where gppercentre is what the field will be called, and num_candidates and payment_eachscript are existing firlds in the query)
in the Field: section under the queries design view you can tyupe things like this.
GPPerCentre: [num_candidates]*[payment_eachscript]
(where gppercentre is what the field will be called, and num_candidates and payment_eachscript are existing firlds in the query)
Last edited by jbennet; Mar 11th, 2007 at 7:14 pm.
If i am helpful, please give me reputation points.
•
•
Join Date: Apr 2009
Posts: 5
Reputation:
Solved Threads: 0
Hey this helps me too - thanks.
Except a little difference for me: I'm wanting a calculation using a decimal constant as follows:
HomePremium: [HomeSum]*[0.00119371]
What I'm trying to do is auto calculate a house insurance premium based on the user input of a Sum Insured called HouseSum.
Eg: Enter $300,000 for HouseSum and the autocalculation in the query multiplies this by a constant (which I have chosen/invented for simplicity) giving the answer: $358.13
But MS Access wont accept my constant. It will multiply two fields easy enough, but not [field] * my [constant].
Where am I going wrong?
Cheers
Except a little difference for me: I'm wanting a calculation using a decimal constant as follows:
HomePremium: [HomeSum]*[0.00119371]
What I'm trying to do is auto calculate a house insurance premium based on the user input of a Sum Insured called HouseSum.
Eg: Enter $300,000 for HouseSum and the autocalculation in the query multiplies this by a constant (which I have chosen/invented for simplicity) giving the answer: $358.13
But MS Access wont accept my constant. It will multiply two fields easy enough, but not [field] * my [constant].
Where am I going wrong?
Cheers
Last edited by firstbateyboy; Apr 23rd, 2009 at 9:20 am.
•
•
Join Date: Apr 2009
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
Is your field called HomeSum or HouseSum? You have it written both ways in your question. Try it without putting [ or ] around your constant.
I have chosen (in the "table" field located under the expression) the table that contains the field "HomeSum". I assume I need this. This causes the syntax error. When I leave the "table" field blank then there is no syntax error. Whats the story?
•
•
Join Date: Mar 2006
Posts: 195
Reputation:
Solved Threads: 21
Check out this little sample I just made. Is this what you are trying to do?
Also, if you are creating the expression, then the table field should be left blank. The query will not add this data to your table nor is the new field you are creating in your table. It is basically just a display only look at it so you do not need to put in anything in the table field.
Also, if you are creating the expression, then the table field should be left blank. The query will not add this data to your table nor is the new field you are creating in your table. It is basically just a display only look at it so you do not need to put in anything in the table field.
Last edited by HI2Japan; Apr 26th, 2009 at 7:20 pm.
Who was the first person to look at a cow and say, "I think I'll squeeze these dangly things here, and drink whatever comes out!"
![]() |
Similar Threads
- date comparison (JSP)
- Query multiple tables with duplicate data (MySQL)
- javascript code for performing calculation when all the columns have the same name (JavaScript / DHTML / AJAX)
- PHP Search pagination problem (PHP)
- JBuilder Gui textArea Help! (Java)
- The Calculator (C++)
Other Threads in the MS Access and FileMaker Pro Forum
- Previous Thread: BD remains open after SELECT
- Next Thread: Employee Call-Out Report
| Thread Tools | Search this Thread |






