How to SELECT DISTINCT but exclude "None"

biocentrism

Board Regular
Joined
Jul 28, 2014
Messages
187
I am trying to write a SELECT DISTINCT query which excludes any result that = "None".

This is what I have written but it does not work:

Code:
SQL = "SELECT DISTINCT [Status] FROM TblMembership WHERE [Status] <> 'None'"

Any ideas how to do this?

Thank you.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
That should work.

What does your data look like?
What are you getting for your results?
Where are you putting this statement, and what are you trying to do with it?
 
Upvote 0
strSql = "SELECT distinct tblMembership.Status FROM tblMembership WHERE (((tblMembership.Status)<>""none""));"

This works for me
 
Upvote 0
I see it didn't take you too long before your cross-posted this question: SELECT DISTINCT but exclude "None"

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links to the other thread (see rule #13 here: http://www.mrexcel.com/forum/board-announcements/99490-forum-rules.html). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,221,825
Messages
6,162,166
Members
451,750
Latest member
dofrancis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top