Skip to main content

I am trying to build a GI using the INItemSite table to display the InventoryID and the MinQty designated for each warehouse. I’m trying to use the following formula to limit to the MinQty from a specific warehouse and will duplicate several times for each warehouse (grouping the results by InventoryID):

=IIf(fINItemSite.SiteID]='Warehouse-01','INItemSite.MinQty],0)

However, when I try to view the results I receive the following error message:

Conversion failed when converting the varchar value 'Warehouse-01' to data type int.

 

Anyone have any suggestions around this? I would imagine this error means the INItemSite.SiteID field does not actually contain the text data but is actually a numeric value assigned to that SiteID, but I can’t figure out how to fix this GI. Seems fairly straightforward.

Hi @mikeho ,

The Site field is an integer.  If you need to reference the human readable code, add INSite to your GI and use INSite.SiteCD in your formula.

Laura 


@mikeho  As indicated by Laura, you can join the INSite with INItemSite with SiteID field.

 and check like below

 

IIf(IINSite.SiteCD]='Warehouse-01',1INItemSite.MinQty],0)

Thank you @lauraj46 and @Naveen Boga! Now to throw a larger wrench into the works…

I need to start from a list of all the inventory items (InventoryItem table) and was going to connect the INItemSite table to that table via the InventoryID field. However, it would seem that the INSite table would need to sit in between these two tables, but I can’t figure out the best way to do this. Any suggestions?


Hi @mikeho ,

No need for it to go in the middle, you should be able to join InventoryItem --> InItemSite and  InItemSite -->INSite.

Hope that helps!

Laura


Guess I was just making it more complicated than it needed to be. Thanks, @lauraj46! That worked fine.


Reply