CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Autocomplete: remove redundant results

Print topic Send  topic

Author Message
tumby1974

Posts: 26
Posted: 05/13/2011, 8:21 AM

I'm using autocomplete so a user can type the first few numbers / letters of a street address, and it will bring up a list that match what they are typing.

The autocomplete is looking at Job Address field to get the results.

However, if there are more than one records with the same Job Address, then the autocomplete result shows all of them.

ex. if user starts typing 123 (for 123 Apple St) and let's say there are 5 records in the DB with job address of "123 Apple St", in the autocomplete it will show all 5 of those.

How can you make it to just show one distinct result? Do I have to add a DISTINCT somewhere in the SQL for this feature?
View profile  Send private message
solesz

Posts: 137
Posted: 05/17/2011, 10:30 PM

Hi,

Definitely you have to use DISTINCT in SQL.
If you set up your query using [Build Query] button, then switch to SQL using drop-down list on the upper-left. Then add distinct.
Drawback of this solution, that after switching to SQL and edit the code you can't use the visual query mode (Table) anymore. So prepare your query 100%, then switch to SQL.

Another solution to duplicate your table - in database system - into a view, where Distinct already applied. Then you can editing your query in codecharge without any problem. Surely it is not the nicest way...

solesz
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.