Skip to content
Advertisement

Subtract scanner value from sql table value

I’m trying to subtract a scanner input from a table value. Here’s a screenshot of my table:

Table 1

Here’s what my code looks like:

The output of my code is:

Here’s what I want my table to look like after subtracting 100 (my scanner input quantity):
Table 2

I’m unsure as to why subtracting my scanner variable (quantity) doesn’t work, and I would appreciate any corrections to my code.

Advertisement

Answer

You are missing a space in the query before the where part, it should be like:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement