I have a job that I run that looks through specific tables using Cross Company -
Since it is grabbing salesline from all the different companies, I want to be sure to link the correct record in all the other tables - so I am using DataAreaID to make sure I only match from like companies. But when I add the DataAreaID lines I get the following error:
Invalid use of the DataAreaId field in a cross-company query.
I have searched the web, but haven't found any information that tells me what I am doing wrong. Can someone point me in the correct direction on this? (I pulled out the partition lines for brevity) Thanks!
WHILE Select crossCompany * From salesLine
where salesLine.createdDateTime >= startOfDateRange
join salesTable
where (salesTable.DataAreaID == salesLine.DataAreaID)
&& (salesTable.SalesID ==salesLine.SalesID )
join inventDim
where inventDim.DataAreaID == salesLine.DataAreaID
&& inventDim.InventDimID == salesLine.InventDimID
join inventTableModule
where inventTableModule.ModuleType == 0
&& inventTableModule.ItemID == salesLine.ItemID
&& inventTableModule.DataAreaID == salesLine.DataAreaID
{
*This post is locked for comments