Calculated field help?

J

Jay

Hi, I have a table with the following fields (and formats):

Model (text format)
RegPlate (text format)
Mileage(number)
InitialValue (number)
Forecast (number)

I want to a query which gives me the following fields:

Model
ForecastVariance (calculated field)

With the ForecastVariance field being: Forecast minus InitialValue where
RegPlate=2005 05 and Mileage=20

I'm just struggling on how to specify the RegPlate and Mileage criteria in
the calculated field expression.

Any help greatly appreicated.

Many thanks,
Jason
 
K

KARL DEWEY

Try this --
SELECT Jay.Model, Jay.RegPlate, Jay.Mileage, Jay.InitialValue, Jay.Forecast,
[Forecast]-[InitialValue] AS ForecastVariance
FROM Jay
WHERE (((Jay.RegPlate)="2005 05") AND ((Jay.Mileage)=20));
 
J

Jay

Thanks Karl, that's great. I appreciate it.

The trouble is I want to also include another calculated field
(ForecastVarianceB), eaxactly the same but with different 'RegPlate' and
'Mileage' criteria, of 2004 04 and 40 respectively. I'm just stumped on how
to do this in the same query.

Any help would be great.

Many thanks,

Jason


KARL DEWEY said:
Try this --
SELECT Jay.Model, Jay.RegPlate, Jay.Mileage, Jay.InitialValue,
Jay.Forecast,
[Forecast]-[InitialValue] AS ForecastVariance
FROM Jay
WHERE (((Jay.RegPlate)="2005 05") AND ((Jay.Mileage)=20));


Jay said:
Hi, I have a table with the following fields (and formats):

Model (text format)
RegPlate (text format)
Mileage(number)
InitialValue (number)
Forecast (number)

I want to a query which gives me the following fields:

Model
ForecastVariance (calculated field)

With the ForecastVariance field being: Forecast minus InitialValue where
RegPlate=2005 05 and Mileage=20

I'm just struggling on how to specify the RegPlate and Mileage criteria
in
the calculated field expression.

Any help greatly appreicated.

Many thanks,
Jason
 

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

Top