
December 20th, 2004, 11:48 AM
|
|
Registered User
|
|
Join Date: Dec 2004
Posts: 8
Time spent in forums: 47 m 4 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by mevasquez I am not sure how to convert the following from an Access query to a MS SQL query statement
Code:
UPDATE B1PEND, AWP_CODE
SET B1PEND.AWP_CODE = 'A'
WHERE (RIGHT(B1PEND.DOC, 4) >= AWP_CODE.[BEGIN])
AND (RIGHT(B1PEND.DOC, 4) <=AWP_CODE.[END])
Apparently, the update statement uses two tables, and depending on the value of the B1PEND.DOC field, will determine whether to update the B1PEND.AWP_CODE to 'A'.
I am not sure how to convert this. Any help would be appreciated.
TIA,
Mike V |
Never mind, I figured it out. I just had to add a from clause.
Code:
UPDATE B1PEND
SET B1PEND.AWP_CODE = 'A'
FROM AWP_CODE
WHERE (RIGHT(B1PEND.DOC, 4) >= AWP_CODE.[BEGIN])
AND (RIGHT(B1PEND.DOC, 4) <=AWP_CODE.[END])
|