i made the form of search of my project as in screen shot in vb.net the problem is that it shows the record many time of one person i put the sql query this
qury = "SELECT p.per_id AS 'Person ID', " & _ "p.per_name AS 'Name', " & _
"p.f_name AS 'Father Name'," & _
"p.per_address AS 'Address', " & _
"p.per_cell AS 'Cell No', " & _
"p.per_cnic AS 'CNIC #', " & _
"c.chak_name As 'Chak', " & _
"r.rev_name As 'Circle', " & _
"t.teh_name As 'Tehsil' " & _
"FROM RRDBMS.dbo.person_info p, RRDBMS.dbo.chak c , RRDBMS.dbo.rev_circle r, RRDBMS.dbo.tehsil t " & _
"WHERE " & _
"p.chak_id = c.chak_id And " & _
"c.rev_id = r.rev_id And " & _
"r.teh_id = t.teh_id And " & _
"p.per_address LIKE '" & address & "'OR " & _
"p.f_name LIKE '" & fname & "' OR " & _
"p.per_name LIKE '" & name & "' OR " & _
"p.per_cnic LIKE '" & cnic & "'OR " & _
"p.per_cell LIKE '" & cell & "' OR " & _
"p.per_id LIKE '" & id & "' "
please help to solve my problem i

Recommended Answers

All 3 Replies

I don't see anything in the WHERE clause that restricts the selection to a particular "Person ID".

Adding DISTINCT to the start (SELECT DISTINCT...) will make sure each row is only output once if the search critieria or the database table itself allow duplicates.

can you please tell me your tables fields .so that i can write query for this prob ?

Regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.