Click here to Skip to main content
15,891,006 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey guys
i want to subtract a value in a field of the record
i have a table that name TableLogin that has 2 field : 1.ID 2.Login
default Login field is 4 i want to every time user login then login field subtract by one
i mean this (Login-1)

What I have tried:

i tried this code
Update Login set Login-1 where ID=2

but its not working and i get the error
how can i subtract (1) from the login field
Posted
Updated 25-Oct-17 1:32am

1 solution

Try:
SQL
UPDATE TableLogin SET Login=Login-1 WHERE ID=2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900