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
Solved

access sql query

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

828 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