If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Delete records
In a table I have two columns that may sometimes hold the
same codes, for Example: Col1 Col2 xxxx xxxx yyyy zzzz pppp pppp I need to run a query that will update col1 to null where the code is the same as what is in col2 so the rsult would be: Col1 Col2 xxxx yyyy zzzz pppp How would I go about this...please help...really stuck with this! Thanks |
#2
|
|||
|
|||
Delete records
Daniel,
Open a new query in design view, select the table and drag and drop the two fields from the table down to the grid. Then in the grid, under Col2, type [Col1] in the first criteria line (if the name of the filed is not Col1 then type in tyhe exact name of the field). So far you have a Select query that selects records where Col1 = Col2. Switch to datasheet view to verify. Then, back to the design view, go to menu Query Update query, to change the type of your query from Select to Update. Notice the new line headed Update To that appears in the grid. Go to that line under field Col1 and type in it "Null" (without the quotes). Now go to menu Query Run, confirm when prompted to accept the cahnges, and you're done. HTH, Nikos "Daniel" wrote in message ... In a table I have two columns that may sometimes hold the same codes, for Example: Col1 Col2 xxxx xxxx yyyy zzzz pppp pppp I need to run a query that will update col1 to null where the code is the same as what is in col2 so the rsult would be: Col1 Col2 xxxx yyyy zzzz pppp How would I go about this...please help...really stuck with this! Thanks |
Thread Tools | |
Display Modes | |
|
|