We help IT Professionals succeed at work.
Get Started

Query to delete records with values of "--"

AndyC1000 asked
Last Modified: 2015-03-12
Dear all,

I have a table imported into Access the structure is below.  There are 7 consecutive dates.

ID  Latitude  Longitude  19/12/2014  20/12/2014  21/12/2014 etc.

I wrote the below query and it works for that dataset, i.e. the next dataset will have dates for the following week.  Is it possible to write a query to check and delete records where all fields except e.ID, e.Latitude, e.Longitude contain "--"  (without including field names)?


SELECT e.ID, e.Latitude, e.Longitude, e.[19/12/2014] AS Expr1, e.[20/12/2014] AS Expr2, e.[21/12/2014] AS Expr3, e.[22/12/2014] AS Expr4, e.[23/12/2014] AS Expr5, e.[24/12/2014] AS Expr6, e.[25/12/2014] AS Expr7 INTO FormattedData
FROM Export_FFDI_Valid_Python AS e
WHERE ((([e].[19/12/2014])<>"--") AND (([e].[20/12/2014])<>"--") AND (([e].[21/12/2014])<>"--") AND (([e].[22/12/2014])<>"--") AND (([e].[23/12/2014])<>"--") AND (([e].[24/12/2014])<>"--") AND (([e].[25/12/2014])<>"--"));

Open in new window

Watch Question
Social distance; Wear a mask; Don't touch your face; Wash your hands for 20 seconds
Top Expert 2014
This problem has been solved!
Unlock 2 Answers and 9 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE