Calculated field

Peter Paul

Registered User.
Local time
Today, 16:06
Joined
Jan 1, 2000
Messages
82
Greetings friends,
I have a problem that I am sure is simple for you, but is evading me right now. I am trying to create a database for someone who reads meters on a monthly basis. The readings are related to the meter, and have the month associated with the reading.

I created a query so that she can pull up the specific meter and a range of months. I want to show the difference in the readings and am having a difficult time figuring out how to make that work.

The field with the data is the same, so not sure how to word the equation.

:rolleyes:

Thank you in advance for your assistance,

Peter
 
You can do this one of two ways:By 1.)adding a field to the query or 2.)adding a textbox to the form and setting its controlsource to the equation you want. I'll submit the former.

Go to your query and add a field to it. (i.e. calculated field).

You can make as many Calculated Fields as you wish and they can be created in your query this way.
CalculatedFieldName:[FieldName1]-[FieldName2](If you wanted to subtract :[FieldName2] from [FieldName1], that is)

CalculatedFieldName:can be a unique name you want w/ a colon @ the end to separate the fields from its name. If you don't provide one it will default to Expr#:

[FieldName1] and [FieldName2] are the fields that you wish to calculate from your query.

Now you will have as many fields as you've added to your query which you can drop onto your form. If your have problems w/ this...submit the query and I'll give it a try.

HTH
 
Last edited:
Say you want to subtract the data in one column from the next. Try the columns property...
Me.FieldName.Column(0)-Me.FieldName.Column(1)

If this makes no sense then look up "Columns" property in help.

HTH
 

Users who are viewing this thread

Back
Top Bottom