Solved

access sql query

Posted on 2013-01-29
5
239 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

756 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