Link to home
Start Free TrialLog in
Avatar of bosscat
bosscatFlag for Malaysia

asked on

Problem with Select Distinct Query

Hi all,

As below as attached is my query to retrieve data from my database.

There is same multiple shortagepn from my database but i just wanted them to appear as 1 on my display table. the thing now is sometimes there is no data found or even duplicated shortagepn appear on my table. is there something wrong with my query or is there anyway i can use other than using the distinct method.

Thanks
Dim qryselect As String = "Select distinct projects.shortagepn, projects.pono,projects.description,projects.uploadby, projects.duedate, projects.poqty,projects.actualbyrname_cus,projects.programtype,projects.shortqty,projects.assembly_mo,outstandingpo.supplier_name,projects.sides,projects.familyid,projects.mono, companyname.companyname FROM (loading.projects INNER JOIN loading.outstandingpo ON outstandingpo.item_number = projects.shortagepn) INNER JOIN loading.companyname ON projects.familyid = companyname.familyid WHERE projects.familyid='" & familyid & "' AND projects.assembly_mo='" & assemblyno & "' AND projects.mono='" & mono & "' AND projects.shortagepn <>''"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of jfmador
jfmador
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bosscat

ASKER

thanks jfmador for the help!