Q
Problem solve Get help with specific problems with your technologies, process and projects.

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 last published in December 2005

Dig Deeper on .NET Development for SQL Server

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.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close