Calculation query for a beginner

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

I wish to do a math calc query so one field is subtracted from another to
give an answer in a new field along the lines of....

Tare In - Tare Out = Nett

I tried along the lines of...

=sum (Tare Out - Tare In) no good.
Sum (Tare Out - Tare In) no good.
Nett: [Tare Out] - [Tare In] no good.
Nett: [(Tare Out)] - [(Tare In)] no good.

any ideas would be appreciated

TIA

Steve
 
Sorry, I think I suffered from premature sending.

Assuming the fields are numeric, this should work. You may need to handle
possible null values in the expression.
Nett: [Tare Out] - [Tare In]

When you state "no good", this is not at all helpful. We assume nothing
worked for you so a more appropriate result or error message would assist us
in helping fix your errors.
 
my apologies..by no good i mean it did not work,

When I use Nett: [Tare Out] - [Tare In]

i do get the error "the in operator you entered requires parentheses"


Thanks Again

Steve


Duane Hookom said:
Sorry, I think I suffered from premature sending.

Assuming the fields are numeric, this should work. You may need to handle
possible null values in the expression.
Nett: [Tare Out] - [Tare In]

When you state "no good", this is not at all helpful. We assume nothing
worked for you so a more appropriate result or error message would assist
us in helping fix your errors.


--
Duane Hookom
MS Access MVP

Steve said:
I wish to do a math calc query so one field is subtracted from another to
give an answer in a new field along the lines of....

Tare In - Tare Out = Nett

I tried along the lines of...

=sum (Tare Out - Tare In) no good.
Sum (Tare Out - Tare In) no good.
Nett: [Tare Out] - [Tare In] no good.
Nett: [(Tare Out)] - [(Tare In)] no good.

any ideas would be appreciated

TIA

Steve
 
I opened the query design window
I added the table
In the first field name I typed:
Nett: [Tare out]-[Tare in]
(which I cut and pasted here.)
I clicked on the run symbol !
and I got the expected answer.

What happens if you do that?

I should mention that it is not considered good practise to have blanks in
field names, though I doubt that is a problem here.

Steve said:
my apologies..by no good i mean it did not work,

When I use Nett: [Tare Out] - [Tare In]

i do get the error "the in operator you entered requires parentheses"


Thanks Again

Steve


Duane Hookom said:
Sorry, I think I suffered from premature sending.

Assuming the fields are numeric, this should work. You may need to handle
possible null values in the expression.
Nett: [Tare Out] - [Tare In]

When you state "no good", this is not at all helpful. We assume nothing
worked for you so a more appropriate result or error message would assist
us in helping fix your errors.


--
Duane Hookom
MS Access MVP

Steve said:
I wish to do a math calc query so one field is subtracted from another to
give an answer in a new field along the lines of....

Tare In - Tare Out = Nett

I tried along the lines of...

=sum (Tare Out - Tare In) no good.
Sum (Tare Out - Tare In) no good.
Nett: [Tare Out] - [Tare In] no good.
Nett: [(Tare Out)] - [(Tare In)] no good.

any ideas would be appreciated

TIA

Steve
 
I doubt this expression is causing your error. You should provide the
complete SQL view of your query.

--
Duane Hookom
MS Access MVP

Steve said:
my apologies..by no good i mean it did not work,

When I use Nett: [Tare Out] - [Tare In]

i do get the error "the in operator you entered requires parentheses"


Thanks Again

Steve


Duane Hookom said:
Sorry, I think I suffered from premature sending.

Assuming the fields are numeric, this should work. You may need to handle
possible null values in the expression.
Nett: [Tare Out] - [Tare In]

When you state "no good", this is not at all helpful. We assume nothing
worked for you so a more appropriate result or error message would assist
us in helping fix your errors.


--
Duane Hookom
MS Access MVP

Steve said:
I wish to do a math calc query so one field is subtracted from another to
give an answer in a new field along the lines of....

Tare In - Tare Out = Nett

I tried along the lines of...

=sum (Tare Out - Tare In) no good.
Sum (Tare Out - Tare In) no good.
Nett: [Tare Out] - [Tare In] no good.
Nett: [(Tare Out)] - [(Tare In)] no good.

any ideas would be appreciated

TIA

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top