Is it possible to perform a calculation in a Query using If...Then...ElseIf?<br>
<br>
This is basically what I want to do<br>
<br>
Amount in Tons: If «Expr» [Unit Type] = gallons then [UnitAmount] * [WasteTypeID] / 2000 ElseIf «Expr» [Unit Type] = Pounds then «Expr» [WasteTypeID] / 2000 ElseIf «Expr» [Unit Type] =Kilograms then «Expr» [UnitAmount] «Expr» *2.205 /2000 ElseIf «Expr» [Unit Type] =Yards then «Expr» [UnitAmount] * 1 EndIF<br>
<br>
I keep getting a syntax error. Any thoughts on how I can do this? Thanks!<br>
<br>
This is basically what I want to do<br>
<br>
Amount in Tons: If «Expr» [Unit Type] = gallons then [UnitAmount] * [WasteTypeID] / 2000 ElseIf «Expr» [Unit Type] = Pounds then «Expr» [WasteTypeID] / 2000 ElseIf «Expr» [Unit Type] =Kilograms then «Expr» [UnitAmount] «Expr» *2.205 /2000 ElseIf «Expr» [Unit Type] =Yards then «Expr» [UnitAmount] * 1 EndIF<br>
<br>
I keep getting a syntax error. Any thoughts on how I can do this? Thanks!<br>