This topic is locked

Calculated fields

9/16/2005 1:26:07 PM
ASPRunnerPro General questions
author

Can anyone see the problems with this query? It all seems to work, except for the mileage calculation at the end. Replies appreciated!
select [ExpenseID],

[Name],

[Date],

[Meals],

[Lodging],

[Supplies],

[Other],

[Mileage Start],

[Mileage End],

Meals+Lodging+Supplies+Other as Total,

Mileage End - Mileage Start * 0.32 as Mileage

From [six_expenses1]

Sergey Kornilov admin 9/19/2005

You forgot square brackets around field names.
PS. Avoid spaces in field names. This will save you from a number of potential problems.

select [ExpenseID],

[Name],

[Date],

[Meals],

[Lodging],

[Supplies],

[Other],

[Mileage Start],

[Mileage End],

Meals+Lodging+Supplies+Other as Total,

[Mileage End] - [Mileage Start] * 0.32 as Mileage

From [six_expenses1]