I am having problems adding and subtracting in ASP, i am using a MySQL database and connecting via MyODBC using a preset DSN connection.
So i have an online store, in the table i am trying to add two fields (total_products) and (total_shipping) and then subtract (total_discounts).
All the above fields are Decimal (10,2) type in the database. If i run a simple query <%=FormatNumber(rs("total_products"))%> the values are fine.
However when i try to actually add and subtract them i get an error, i think the error is because the values are strings.
Code is below thank you;
Expand|Select|Wrap|Line Numbers
- TotalPrice = rs("total_products")
- TotalPrice = TotalPrice + rs("total_shipping")
- TotalPrice = TotalPrice - rs("total_discounts")
Expand|Select|Wrap|Line Numbers
- Microsoft VBScript runtime error '800a000d'
- Type mismatch
- /assets/includes/admin/orders_orders.asp, line 87
total_products = 1844.51
total_shipping = 18.97
total_discounts = 221.34
as mentioned above these three fields are decimal(10,2).
All help appreciated
Regards,
Justin