-
Update query
Hi,
Can anyone tell if the following update query looks just about right?
UPDATE [AC Case] SET [AC Case].Magistrate_ID = 6
WHERE [AC Case].[Case_ID]=22 And [AC Case].[Case_ID]=23;
The table name is AC Case
The field that I want to update is called Magistrate_ID
And I just want to update the magistrate_ID in cases 22 and 23.
Cheers
Andy
-
Re: Update query
I think you want to say OR rather than AND in the WHERE clause. The Case_ID
field in a record can't be both 22 and 23 at the same time.
"Andy" <andrew.constable@ntlworld.com> wrote:
>
>Hi,
>Can anyone tell if the following update query looks just about right?
>
>UPDATE [AC Case] SET [AC Case].Magistrate_ID = 6
>WHERE [AC Case].[Case_ID]=22 And [AC Case].[Case_ID]=23;
>
>The table name is AC Case
>The field that I want to update is called Magistrate_ID
>And I just want to update the magistrate_ID in cases 22 and 23.
>
>Cheers
>Andy
>
-
Re: Update query
Looks good Andy.. try this
UPDATE [AC Case]
SET [AC Case].Magistrate_ID = 6
WHERE [AC Case].[Case_ID] in (22,23)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks