[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

access sql query

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
aplona
Asked:
aplona
  • 2
  • 2
1 Solution
 
mbizupCommented:
That would be an update query...

Update yourtable
Set fld1 = null, fld2= null etc
0
 
LaurianneCommented:
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
 
aplonaAuthor Commented:
I figured it out.  I can do the update through design view.
0
 
aplonaAuthor Commented:
I've requested that this question be deleted for the following reason:

completed through design view.
0
 
mbizupCommented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now