Pregunta

I'm trying multiply discount_v times item_qty + total_discount but i keep getting the error Microsoft VBScript runtime error '800a000d' Type mismatch.

Can anyone tell me what I'm doing wrong, please! Here is the code I am using:

total_discount = (discount_v * item_qty) + total_discount
¿Fue útil?

Solución

Try this:

 total_discount = (CDbl(discount_v) * CInt(item_qty)) + CDbl(total_discount) 

Better yet use these type conversion functions when you initially assign the variables.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top