Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / February 2008

Tip: Looking for answers? Try searching our database.

update query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
peljo - 29 Feb 2008 06:43 GMT
How can i build a query where all the rows having -. for example -1, or -2
etc, to be set to o ?
John W. Vinson - 29 Feb 2008 07:15 GMT
>How can i build a query where all the rows having -. for example -1, or -2
>etc, to be set to o ?

Create a Query based on your table.

On the Criteria line under the relevant field, put your criterion - for
instance just -1 or

IN (-1, -2)

if you want all records with either of these values changed. Open the query as
a datasheet just to be sure it's selecting the records you want!

Change the query to an Update query.

Put 0 on the Update To line.

Run the query.
Signature

            John W. Vinson [MVP]

peljo - 29 Feb 2008 07:21 GMT
Thank you very much for your reply. I need a query that automatically updates
all the entries being < 0 and updating them to 0. is it possible ?

>>How can i build a query where all the rows having -. for example -1, or -2
>>etc, to be set to o ?
[quoted text clipped - 14 lines]
>
>Run the query.
peljo - 29 Feb 2008 07:21 GMT
Thank you very much for your reply. I need a query that automatically updates
all the entries being < 0 and updating them to 0. is it possible ?

>>How can i build a query where all the rows having -. for example -1, or -2
>>etc, to be set to o ?
[quoted text clipped - 14 lines]
>
>Run the query.
John Spencer - 29 Feb 2008 12:31 GMT
UPDATE YourTable
SET YourField = 0
WHERE YourField <0

In query design view
-- Open a new query
-- Select your table
-- Add the field you want to change to the grid
-- Set the criteria under the field to < 0
-- Select Query: Update from the menu
-- Type 0 into the Update To "cell"

Signature

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
.

> Thank you very much for your reply. I need a query that automatically
> updates
[quoted text clipped - 20 lines]
>>
>>Run the query.
mcescher - 29 Feb 2008 16:00 GMT
> Thank you very much for your reply. I need a query that automatically updates
> all the entries being < 0 and updating them to 0. is it possible ?

peljo,

Instead of "IN (-1,-2)" use "<0"

That should do the trick!

Chris M.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.