PDA

View Full Version : Delete A Record If a Field has 6 Characters Or Less



Mattster2020
09-09-2008, 03:48 AM
Afternon All,

I have a column in my table (Ref), if a record has six characters or less I wish to delete the record from the table. Is this possible to do in the query builder?

Regards,

Mattster

CreganTur
09-09-2008, 05:27 AM
Yes, you can easily build a SQL query to do what you want. I don't know if you can do it in the query builder view... mainly because for things like this I write the SQL by hand.

The following is untested, but should work for you. If it doesn't, it's probably a syntax error involving the Len function.

DELETE Ref.*
FROM Ref
WHERE Len(Ref.Field) < 7