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.
bettybarnes 7 Posting Whiz in Training
Recommended Answers
Jump to PostNot sure exactly what is your confusion.
All arithmetic operations works on database tables while used as part of a SQL.
Jump to Posthow exactly are you handling these DB transactions ?
Jump to PostHeres some code.
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 …
Jump to Postlets see the code that you are working on and fix it now itself.
Jump to Postyou need to update the table row with the new data after the transaction.
if
current_quantity = 10
order = 2so new_quantity = 10 -2 =8
that is what you needs to do
update table_name set quantity = quantity - 2;
All 17 Replies
debasisdas 580 Posting Genius Featured Poster
bettybarnes 7 Posting Whiz in Training
bettybarnes 7 Posting Whiz in Training
debasisdas 580 Posting Genius Featured Poster

Unhnd_Exception
sandeepparekh9 109 Posting Whiz

Unhnd_Exception
debasisdas commented: :) +9
bettybarnes 7 Posting Whiz in Training
debasisdas 580 Posting Genius Featured Poster
bettybarnes 7 Posting Whiz in Training
debasisdas 580 Posting Genius Featured Poster
bettybarnes 7 Posting Whiz in Training
debasisdas 580 Posting Genius Featured Poster
bettybarnes 7 Posting Whiz in Training
debasisdas 580 Posting Genius Featured Poster
bettybarnes 7 Posting Whiz in Training
debasisdas 580 Posting Genius Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.