[RESOLVED] finding distinct element from an array
Hi,
i have an array with wild character at the end. I use the value in this array in Select statment. Some times the array has same values. I want only distinct values in the array before the select statment. Can some one throw an idea on how to do this
Code:
for i=0 to count
select * from tbl where item like ' " & itemname(i) & "'
next
I need distinct element in itemname array
Re: finding distinct element from an array
Found the solution
Code:
For i = 0 To cno
notfoundelement = True
For j = 0 To cno
If itemname(i) = sortarray(j) Then
notfoundelement = False
End If
Next
If notfoundelement = True Then
sortarray(elementcount) = itemname(i)
elementcount = elementcount + 1
End If
Next