Calculated field help?

  • Thread starter Thread starter Jay
  • Start date Start date
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
 
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));
 
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
 
Back
Top