I'm using SQL for a classic ASP page and in a part of the code I have this:
If (opcao = 1) Then
If credito > 0 Then
SQL = "UPDATE FO_Passaportes SET creditoTotal = creditoTotal + " & credito & " WHERE IDPassaporte = " & IDPassaporte & ""
Else
SQL = "UPDATE FO_Passaportes SET creditoUsado = creditoUsado + " & Abs(credito) & " WHERE IDPassaporte = " & IDPassaporte & ""
End If
End If
If (opcao = 2) Then
SQL = "UPDATE FO_Passaportes SET creditoTotal = creditoTotal - " & Abs(credito) & " WHERE IDPassaporte = " & ID Passaporte & ""
End If
When I run I am getting the following error:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/GIP-eP/Formation/passports/overpassport.asp, line 234
SQL="UPDATE FO_Passports SETTotal credit = Total credit -" & Abs (credit) & "WHERE IDPassport=" & ID Passport & "------------------------------------------------ -------------------------------------------------- -------------- ^
The error is pointing to my last query:
If (opcao = 2) Then
SQL = "UPDATE FO_Passaportes SET creditoTotal = creditoTotal - " & Abs(credito) & " WHERE IDPassaporte = " & ID Passaporte & ""
End If
What am I doing wrong ??