dotnetspider.com
Login Login    Register      

TutorialsForumCareer DevelopmentResourcesReviewsJobsInterviewCommunitiesProjectsTraining

Subscribe to Subscribers
Talk to Webmaster
Tony John

Facebook
Google+
Twitter
LinkedIn
Online MembersPhagu Mahato
Ranjith Kumar
Sarfaraz M Bhat
Shine S
More...
Join our online Google+ community for Bloggers, Content Writers and Webmasters




Forums » .NET » SQL Server »

Medical shop code-- sql server 2000 purchase and sales using sum


Posted Date: 07 Jul 2012      Posted By:: ashok     Member Level: Bronze    Member Rank: 0     Points: 2   Responses: 1



in sql server 2000 ,

purchase and sales using sum whereby purchase decreases when say,

Example:-purchase =50 and sales =25 and purchase gets decreased by=50-25=25

when sales from purchase is made,purchase decreases as in the above example.




Responses

#679589    Author: Nathaniel Nellas Sumaya      Member Level: Silver      Member Rank: 1262     Date: 09/Jul/2012   Rating: 2 out of 52 out of 5     Points: 2

DECLARE @purchase decimal(10,8)

SET @purchase = 25

SELECT purchase-@purchase FROM purchaseTable

-- Update your purchase table

UPDATE purchaseTable
SET purchase =purchase-@purchase



 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : Sql server 2005 query
Previous : Use of row lock & table when to choose one of them
Return to Discussion Forum
Post New Message
Category:

Related Messages



Follow us on Twitter: https://twitter.com/dotnetspider

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Email subscription
  • .NET Jobs
  • .NET Articles
  • .NET Forums
  • Articles Rss Feeds
    Forum Rss Feeds


    About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    Revenue Sharing sites   Advertise   Talk to Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.