質問

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
役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top