Thank you for typing out your words. I'm not trying to hassle you--believe me, but some more tips to help you get good replies here on Daniweb or any forum:
Don't paste so much code to ask a specific question. Your question is regarding how to construct the SQL statement, but you posted a whole section of ASP code.
When you post code, use the code tags. They set your code apart, keep your spacing intact, and provide syntax highlighting for some languages. You can insert code tags using the last icons in the list of icons across the top of the editor. For example,
myVar = "Hey, I used a code tag!"
Response.WRITE myVar
Response.END
To query all rows from a table based on a single column not being null or an empty string, you can do this:
sql = "select * from myTable where myCol is not NULL and myCol <> ''"
'By the way, you should not use * to select columns in production
'code--specifically name your columns.
The tricky part is that an empty string is not the same thing as NULL, so you have to check for both, unless you've always been careful to insert NULL instead of empty strings.
As you know
% is a wildcard indicator. It means anything OR nothing.
'
%ed' will match 'fred','red','busted', 'ed'
'%ed%' will match 'sedate', 'educate', 'bed', 'ed'