hi guys i would like to ask how do I subtract a value from my column Quantity(data type is integer = 18) in my inventory table if a customer will want to have 2 orders and of course 18 - 2 will be 16. how will i do this? please help me.
if my remaining quantity is 18 and my customer buys 2 pencils for example, of course the quantity will be reduced to 16. and what if my customer wants to buy 20 pencils, it should display a warning message saying, there's insufficient quantity in ur inventory..
This will return a point on a circle given the center point of the circle, the radius, and the angle the point should be at.
Public Function GetPointOnCircle(ByRef centerPoint As PointF, ByRef radius As Double, ByVal angle As Single) As PointF
Return New PointF(CSng(Math.Cos((Math.PI / 180) * angle) * radius + centerPoint.X), CSng(Math.Round(Math.Sin((Math.PI / 180) * angle) * radius + centerPoint.Y, 2)))
Heres a query string
Set Quantity = Quantity - 2
Where InventoryItem = Pencil
ahm it's about my sql queries.. i dont have an idea... my application im making is Inventory system wherein if my customer wants to buy 2 pencils and my remaining pencils are 18 in the database it should deduct automatically 2 pencils resulting to 16 pencils..
thanks i was thinking this solution before. but what if another order is done. the customer asks for 4 pencils? since update table_name set quantity = quantity - 2; is the code you gave me.. do i need to set a variable like this order = @variable? if 4 pencils need to be deducted in the table