Re: Distinct

You should to populate the ComboBox in this way:

procedure Form1_OnShow (Sender: string; Action: string);
begin
    frmpelatis.ComboBox1.dbSQLExecute ('SELECT DISTINCT name.name, name.id FROM name GROUP BY name.name');
end;
Dmitry.

Re: Distinct

do you have teamviewer on your pc?if yes let me know

v_pozidis wrote:

I have installed the 2.2
But the script   http://myvisualdatabase.com/forum/misc. … download=1   works only fro the first record.
After that it let you to add records with the same names

Re: Distinct

yes I have teamviewer


whats your e-mail?

Re: Distinct

give me your id and password

Re: Distinct

pha1984@yandex.com

Re: Distinct

pha1984 wrote:

pha1984@yandex.com

I send it on your e-mail

Re: Distinct

Hi v_pozidis!
I attached your project here. Maybe it will be helpful for others.

Post's attachments

Attachment icon distinct_fixed3.zip 327.04 kb, 441 downloads since 2016-01-15 

Re: Distinct

pha1984 wrote:

Hi v_pozidis!
I attached your project here. Maybe it will be helpful for others.

Great job.
Could you please explain whats count means and also the upper and lower ?

existing_name_count1 := SQLExecute('SELECT COUNT(name) FROM name WHERE upper(name)=upper("'+new_name+'")');
existing_name_count2 := SQLExecute('SELECT COUNT(name) FROM name WHERE lower(name)=lower("'+new_name+'")');

Re: Distinct

1. The Count() function returns the number of rows that matches a specified criteria.
2. Lower and Upper functions convert  the value of a field to lowercase and uppercase respectively.

v_pozidis wrote:
pha1984 wrote:

Hi v_pozidis!
I attached your project here. Maybe it will be helpful for others.

Great job.
Could you please explain whats count means and also the upper and lower ?

existing_name_count1 := SQLExecute('SELECT COUNT(name) FROM name WHERE upper(name)=upper("'+new_name+'")');
existing_name_count2 := SQLExecute('SELECT COUNT(name) FROM name WHERE lower(name)=lower("'+new_name+'")');