This topic is locked

query calculations...

9/27/2005 21:25:17
ASPRunnerPro General questions
author

I'm using the following to calculate mileage reimbursement. The results are way off... Can anyone tell me what I'm doing wrong?
gstrSQL = "select [ExpenseID], [Name], [Date], [Mileage Start], [Mileage End], *[Mileage End] - [Mileage Start] 0.0032 as Total** From [six_expenses1] Where Name= 'Linda'"

500324 9/27/2005

DUH! As usual, I figured it out right after I posted my question. Forget the ()... I'm so embarassed...

lhastings 9/29/2005

Hi, I'm stuck trying to do something similar
My query is:
select [IR_ID],

[IR_OrderNumber],

[IR_Quantity],

[IR_VersionCode],

[IR_PricePerItem],

[IR_VersionName],

[IR_PricePerItem] * 0.175 as IR_TaxPerItem

From [tblCactuShopInvoiceRows]
This displays a value on the list page but only if the field is set to Readonly in ASPRunners 'Formatting - Edit as' and it does not get recorded in the DB (where it's needed) Everything else I try kicks up the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Duplicate output destination 'IR_PricePerItem'.

/customer/tblCactuShopInvoiceRows_add.asp, line 453
What are the brackets for that you said you left out??
Thanks

500325 9/29/2005

There are two ways to do calculated fields in asprunner as shown here: http://www.xlinesoft.com/asprunnerpro/arti...ated_fields.htm
The method you are using only displays the new calculation field on the list page. Try method 2 at the end of the page (it looks really complicated!).
Good luck...