Q

Using DISTINCT in a SQL query

Development expert Greg Low explains the purpose of DISTINCT and how to send a query to SQL Server from VBA.

How can I use DISTINCT in an SQL query in VBA? Please provide an example. Thanks!
I'm not sure what the limitation here that you're asking about is. DISTINCT simply limits the returned rows to avoid having duplicate entries. If you are sending a query to SQL Server from VBA, you can specify the DISTINCT modifier in a query the same way you would in a SQL query tool ie: SELECT DISTINCT SomeColumns FROM SomeTable
This was first published in December 2005

Dig Deeper

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close