Query to Delete certain fields not records

J

Jay

I have a table with four descriptive text fields & 16 numerical fields,
containing values between 150 and -150. It contains approx' 400,000 records.

I want to delete all values in the numerical fields between -20 and 20.
I don't know how to do this as my understanding of delete queries is
that they delete the whole record where any specified field-level
criteria are met.

Alternatively I'd like to simply Select all values < -20 Or >20 (along
with the 4 related text fields for qualifying records). However, I
don't know how to do this as when I try a Select Query with the relevant
Or criteria it displays the *whole* record (which could effectively
contain only 1 of the 16 numerical fields which is <-20 Or >20...I want
to select the record if any of the numerical fields are <-20 Or >20 but
only return the four text fields and the qualifying number field - I
want the non-qualifying number fields to be displayed as null).

If anyone could help me to do either I'd be extremely grateful.

Jason
 
J

Jeff L

I want to delete all values in the numerical fields between -20 and 20.
I don't know how to do this as my understanding of delete queries is
that they delete the whole record where any specified field-level
criteria are met.

You would have to run an update query to do this.
UPDATE YourTableName
Set YourFieldName = Null
Where YourFieldName Between -20 And 20

For the second part, you could put this in a column header for each
value:
IIF(([Field1] >= 20) OR ([Field1] <= -20), [Field1], Null) then in
another column heading
IIF(([Field2] >= 20) OR ([Field2] <= -20), [Field2], Null) and so forth

Hope that helps!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top