Skip to main content
Question

Left join query with specific condition not returning all records?

  • February 9, 2026
  • 3 replies
  • 38 views

Forum|alt.badge.img

I’m wanting to show the qty available in two different warehouses as two columns.  The records should all still come through, regardless of whether there is qty available or not.  For this reason I used a left join:

 

But this left join should only be for records from a specific warehouse, so I added the following condition:

 

 

I would expect to see all inventory records, but only some are being returned.

Do I have to use a subquery?  What is wrong with my condition that can be improved?

3 replies

lauraj46
Captain II
Forum|alt.badge.img+9
  • Captain II
  • February 9, 2026

Hi ​@MarciaW ,

You should move the SiteID filter to the relations tab.  This will allow you to return the record whether or not the INLocationStatus records exists for that warehouse. 

FYI, on the relation you will need to lookup and filter using the integer that represents the SiteID primary key, since the Relation doesn’t offer the ‘From Schema’ option. 

Hope this helps!

Laura


BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • February 9, 2026

@MarciaW Have you tried adding the warehouse to the data links of the join?

 


KrunalDoshi
Freshman II
Forum|alt.badge.img
  • Freshman II
  • February 10, 2026

Hi ​@MarciaW,

You have to inner join with INSite and INLocationStatus. And use the SiteCD in your relation joins for a particular Warehouse. Take a look at below screenshots. Hope this will help.

  1. Datasources
  1. Relation between InventoryItem and Location A
  1. Relation between InventoryItem and Location B 
  1. Relation between Location A and Site A
  1. Relation between Location B and Site B 
  1. Result of GI

I have also attached the GI for your reference.