Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 23rd, 2004, 01:52 PM
jessie2477's Avatar
jessie2477 jessie2477 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 293 jessie2477 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 30 m 12 sec
Reputation Power: 5
Querystring

I'm trying to update one column from one table, but I need the information from other table to update it.
So my querystring is like this
UPDATE InventoryStockTotal, ShoppingCart
SET InventoryStockTotal.dblUnitsAllocated = (InventoryStockTotal.dblUnitsStock + ShoppingCart.Quantity)
WHERE InventoryStockTotal.strProductID = tblShoppingCart.strProductID AND ShoppingCart.strCartID = @strCartID
but I get an error msg. "Incorrect syntax near ',' line 1.
anyone can help me?

Reply With Quote
  #2  
Old August 23rd, 2004, 10:52 PM
Tonny-Soeroso Tonny-Soeroso is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 36 Tonny-Soeroso User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 56 m 27 sec
Reputation Power: 0
Thumbs up

update InventoryStockTotal
set InventoryStockTotal.dblUnitsAllocated = (InventoryStockTotal.dblUnitsStock + ShoppingCart.Quantity)
from InventoryStockTotal, ShoppingCart
where InventoryStockTotal.strProductID = tblShoppingCart.strProductID AND ShoppingCart.strCartID = @strCartID
Just try that query.
Regards,
Tonnys

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Querystring


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway