Solved

access sql query

Posted on 2013-01-29
5
248 Views
Last Modified: 2013-01-30
I need to create a query that would delete all data in a table minus one field that needs to stay.  Not deleteing rows. just the data in them
0
Comment
Question by:aplona
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 250 total points
ID: 38832511
That would be an update query...

Update yourtable
Set fld1 = null, fld2= null etc
0
 

Expert Comment

by:Laurianne
ID: 38832522
You could try a "set column_name = null" for all the columns except for the one that you do not wish to blank?

update tablename
set tablename_field2 -= null,
     tablename_field3 = null,
..... and so on blanking all the columns with nulls except for the one you will not list here.  

Tablename being your table's name and tablename_field# being the columns you wish to blank.. just leave the one you do not want blanked alone.  

Hope this helps!
0
 
LVL 3

Author Comment

by:aplona
ID: 38832562
I figured it out.  I can do the update through design view.
0
 
LVL 3

Author Comment

by:aplona
ID: 38832591
I've requested that this question be deleted for the following reason:

completed through design view.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38832592
The original question didn't specify design or sql view.

The sql generated by this query created in design view is going to be basically what we responded with here.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question