Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Very Simple Update Query

Status
Not open for further replies.

ptrifile

Technical User
Aug 10, 2004
457
US
I have one table that has about 30 different fields what I would like to do is if the field contains "N/A" i would like it to change to ""

When i create the query i can get it to do this but only for the first field listed it seems to ignore the rest. Any suggestions on what may be wrong?

Thanks in advance,

Paul
 
An UPDATE query must specify each field that you want to update. You can do something like
Code:
UPDATE tbl SET fld1 = IIF(fld1="N/A", "", fld1), 
               fld2 = IIF(fld2="N/A", "", fld2), 
               fld3 = IIF(fld3="N/A", "", fld3), 
               etc.
 
Easier way:

1. Open the table in datasheet view (the Excel-like grid)
2. Press Ctrl+H for the Replace dialogue
3. Enter N/A in the Find What field
4. Leave the Replace with field blank
5. Change the Look In combo to "MyTableName: Table"
6. Click Replace All

Job done!

[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top