Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
DHall
Starting Member
1 Post |
Posted - 2006-04-13 : 14:59:27
|
| New to SQL scripts.. what's wrong here? -besides that I don't know what I am doing? UPDATE TESTF.DBO.PURCHASE_ORDER_LINE.DESIRED_RECEIVE_DATE IN (SELECT TEST.DBO.CUST_ORDER_LINE.DESIRED_SHIP_DATE FROM TEST.DBO.CUST_ORDER_LINE, TEST.DBO.CUSTOMER_ORDER WHERE TEST.DBO.CUSTOMER_ORDER.ID = TEST.DBO.CUST_ORDER_LINE.CUST_ORDER_ID AND TEST.DBO.CUSTOMER_ORDER.CUSTOMER_ID='FTC' AND TEST.DBO.CUSTOMER_ORDER.STATUS='R') WHERE TESTF.DBO.PURC_ORDER_LINE.PURC_ORDER_ID = TESTF.DBO.PURCHASE_ORDER.ID TESTF.DBO.PURCHASE_ORDER.VENDOR_ID='L&E' AND TESTF.DBO.PURCHASE_ORDER.STATUS='R' AND TESTF.DBO.PURC_ORDER_LINE.TOTAL_RECEIVED_QTY < TESTF.DBO.PURC_ORDER_LINE.ORDER_QTY AND TESTF.DBO.PURC_ORDER_LINE.PURC_ORDER_ID = TEST.DBO.CUSTOMER_ORDER.CUSTOMER_PO_REF AND TESTF.DBO.PURC_ORDER_LINE.LINE_NO = TEST.DBO.CUST_ORDER_LINE.LINE_NOError messages.. Server: Msg 156, Level 15, State 1, Line 2Incorrect syntax near the keyword 'IN'.Server: Msg 156, Level 15, State 1, Line 12Incorrect syntax near the keyword 'WHERE'. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-04-13 : 18:57:57
|
Are you trying to update the table with some value ?the syntax should beupdate tablename set col1 = something, col2 = somethingwhere somecondition KH |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-04-13 : 22:53:49
|
i believe you need something like this, you're missing the actual update (set)quote: from bolUPDATE titlesSET price = price * 2WHERE pub_id IN (SELECT pub_id FROM publishers WHERE pub_name = 'New Moon Books')
--------------------keeping it simple... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|