How can i build a query where all the rows having -. for example -1, or -2
etc, to be set to o ?
>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.