alfonso
Posts: 121
|
| Posted: 05/29/2008, 10:31 PM |
|
I fill a listbox with values of a table, but I don't want to repeat several identical values. For example, if I have: dog, cat, lion, cat, dog I don't want to appears all. I only want to appears cat, dog, lion.
Codecharge Studio 4. Thanks
|
 |
 |
ReneS
Posts: 225
|
| Posted: 05/30/2008, 1:23 AM |
|
Hi,
Fill your listbox with a "DISTINCT" query. Then you will have unique values.
Rene
|
 |
 |
alfonso
Posts: 121
|
| Posted: 05/30/2008, 1:32 AM |
|
Where exactly?. I select listbox. I go to properties -> Data. And where must I write this? What value must have inito Data Source Type and into Data Source?
Thanks again
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 05/30/2008, 2:02 AM |
|
@ alfonso
The Lisbox's properties, click the DataSource [...]
Will show SELECT.... FROM..... WHERE in left pane.
Click SELECT, lower pane will either show a * or fieldname
IF * chan ge it to DISTINCT(fieldname) if fieldname just click it, press F2 to edit and add DISTINCT( ) around it.
You ight need to fill the ALIAS field with the original fieldname
Press SQL icon to show the SQL it should start with
SELECT DISTINCT(fieldname) as fieldname FROM....................
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
alfonso
Posts: 121
|
| Posted: 05/30/2008, 10:22 AM |
|
It is correct. OK
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 05/30/2008, 11:29 AM |
|
Plesae change title to [Resolved]..........
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
|