April 12, 2007 at 9:15 am
INNER JOIN
(SELECT OrganisationID, kMembStatusCode, StatusDate FROM Membership WHERE kOtherClassDescID = @IDTo AND kMembStatusCode = @Term) B
ON A.OrganisationID = B.OrganisationID
April 12, 2007 at 9:33 am
Try:
UPDATE B
SET kMembStatusCode = 2
,StatusDate = GETDATE()
FROM Membership B
JOIN OrgsToAppend A
ON B.OrganisationID = A.OrganisationID
WHERE A.Member = 1
AND B.kOtherClassDescID = @IDTo
AND B.MembStatusCode = @Term
April 12, 2007 at 9:37 am
or:
UPDATE Membership
SET kMembStatusCode = 2
,StatusDate = GETDATE()
WHERE EXISTS (
SELECT *
FROM OrgsToAppend A
WHERE Membership.OrganisationID = A.OrganisationID
AND A.Member = 1
)
AND kOtherClassDescID = @IDTo
AND MembStatusCode = @Term
April 12, 2007 at 9:42 am
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply