Distinct command clarification

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following sql query. I want the STREET to be DISTINCT and only get
the first occurance but keep the other data. Can anyone help me with syntax
on modifying what I have? Thanks in advance!


SELECT [High Propensity Voter Non Absentee].NAME, [High Propensity Voter Non
Absentee].STREET, [High Propensity Voter Non Absentee].CITY, [High Propensity
Voter Non Absentee].STATE, [High Propensity Voter Non Absentee].ZIP, [High
Propensity Voter Non Absentee].VH03082005, [High Propensity Voter Non
Absentee].VH11022004
FROM [High Propensity Voter Non Absentee]
WHERE ((([High Propensity Voter Non Absentee].CITY)="EL DORADO HILLS") AND
(([High Propensity Voter Non Absentee].VH03082005)="V" Or ([High Propensity
Voter Non Absentee].VH03082005)="A") AND (([High Propensity Voter Non
Absentee].VH11022004)="V" Or ([High Propensity Voter Non
Absentee].VH11022004)="A"))
ORDER BY [High Propensity Voter Non Absentee].STREET;
 
You can't do what you want in a query - a query always returns the same
number of columns and if there is data it always fills the data.

You can generate a printed report which could look like

STREET
Name City State ZIP VH... VH...

Or even
Ave A Bob Jones 123 Anywhere El Dorado Hills CA 22222 ...
Jen Smith 243 Ave A El Dorado Hills CA 22111 ...

You can use one of two techniques to do that.
A) Group by street using the report's Sorting and Grouping dialog (View:
Sorting and Grouping) or
B) Use the Street control's hide duplicates property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top