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.

 All Forums
 Other Forums
 MS Access
 Another nesting question.

Author  Topic 

MikeB
Constraint Violating Yak Guru

387 Posts

Posted - 2003-10-22 : 08:07:46
I can have several records with different barcodes as primary keys. I want to update only a few of them and set a field vlue. Can this be done using nesting?

UPDATE tblStructuralSchedule SET PourNumber = 2
SELECT TOP 2 (*) FROM tblStructuralSchedule ORDER BY Barcode DESC

Any Ideas?

Mike B

MikeB
Constraint Violating Yak Guru

387 Posts

Posted - 2003-10-22 : 08:20:27
I think I got it!

UPDATE tblStructuralSchedule
SET PourNumber = 2
WHERE (Barcode IN
(SELECT TOP 2 Barcode
FROM tblStructuralSchedule
ORDER BY Barcode DESC))
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-10-22 : 08:24:37
13 minutes flat...this forum really does have powers!

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=29444


Make it idiot proof and someone will make a better idiot
Go to Top of Page
   

- Advertisement -