# BAQ - Select Distinct

**URL:** <https://www.epiusers.help/t/baq-select-distinct/48384>\
**Category:** Epicor ERP 10\
**Created:** [October 2, 2018, 6:37pm UTC](https://www.epiusers.help/t/baq-select-distinct/48384 "2018-10-02T18:37:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![changchai](https://www.epiusers.help/letter_avatar_proxy/v4/letter/c/f17d59/32.png) [@changchai](https://www.epiusers.help/u/changchai)\
**Post date:** [October 2, 2018, 6:37pm UTC](https://www.epiusers.help/t/baq-select-distinct/48384/1 "2018-10-02T18:37:39Z")

</div>

Any ideas how I can return distinct records? I am basically joining the Part to the VendPart table, but it’s returning duplicate entries.

Here’s my BAQ with a Left outer join from Part to VendPart based off “Company” and “PartNum”.  
 ![image](https://epiusers.help/uploads/default/original/2X/2/23ad36e27c2f7eb14be94b149c2588eeaf3d6d6a.png)

This is my return. It’s basically the same, but I cannot have it do a select distinct.  
 ![image](https://epiusers.help/uploads/default/original/2X/0/0b757cce6f20f4fd7eb61f55d62fb6639826b2e5.png)

As you can see I only have one part linked to this supplier. Only thing I noticed when I queried just the “VendPart” table is that the effective date changed from 10/2 to 10/3, creating 2 records.

 ![image](https://epiusers.help/uploads/default/original/2X/7/7622a72fc8f23346d4ca6e6e452ea85c73f17517.png)

Without having to write a view and use external BAQ, any ways I can get “Select Distinct” in my query?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lang](https://www.epiusers.help/user_avatar/www.epiusers.help/jonathan_lang/32/63295_2.png) [@Jonathan\_Lang](https://www.epiusers.help/u/Jonathan_Lang)\
**Post date:** [October 2, 2018, 6:52pm UTC](https://www.epiusers.help/t/baq-select-distinct/48384/2 "2018-10-02T18:52:21Z")

</div>

You can see the solution to your problem here: [BAQ - Get records where one field is unique - ERP 10 - Epicor User Help Forum](https://epiusers.help/t/baq-get-records-where-one-field-is-unique/37303)

---

<div class="post-metadata">

**Author:** ![michaelpalecek](https://www.epiusers.help/letter_avatar_proxy/v4/letter/m/eb9ed0/32.png) [@michaelpalecek](https://www.epiusers.help/u/michaelpalecek)\
**Post date:** [October 2, 2018, 6:58pm UTC](https://www.epiusers.help/t/baq-select-distinct/48384/3 "2018-10-02T18:58:32Z")

</div>

Or if you are just trying to use the distinct operator as you would in SQL, go to Query Builder, SubQuery Options, Result Set Rows. Change All to Distinct. ![image](https://epiusers.help/uploads/default/original/2X/d/d32dcc5d483949947391afc47336582002b1af3c.png)

---

<div class="post-metadata">

**Author:** ![changchai](https://www.epiusers.help/letter_avatar_proxy/v4/letter/c/f17d59/32.png) [@changchai](https://www.epiusers.help/u/changchai)\
**Post date:** [October 2, 2018, 7:04pm UTC](https://www.epiusers.help/t/baq-select-distinct/48384/4 "2018-10-02T19:04:27Z")

</div>

Ah thank you. Was looking all over for that distinct option. That works.

---

<div class="post-metadata">

**Author:** ![randallweber](https://www.epiusers.help/user_avatar/www.epiusers.help/randallweber/32/4386_2.png) [@randallweber](https://www.epiusers.help/u/randallweber)\
**Post date:** [October 13, 2021, 8:40pm UTC](https://www.epiusers.help/t/baq-select-distinct/48384/5 "2021-10-13T20:40:09Z")

</div>

I am trying to do the same but in E9 where they don’t have sub-queries. Is it possible?
