| 
	 | 
| 
			
			 | 
		#1 | 
| 
			
			 Участник 
		
			
	 | 
	
	
	
		
		
			
			
			Связь таблиц InventTrans и PurchLine
			 
			
			Здравствуйте!!!! 
		
		
		
		
		
		
		
	Помогите разобраться в следующей проблеме: Высчитываю остаток по номенклатурам на дату : WHILE SELECT ItemId, sum(Qty), sum(CostAmountPosted) FROM inventTrans GROUP BY ItemId WHERE InventTrans.DateFinancial < fromDate && InventTrans.StatusIssue != StatusIssue::OnOrder && InventTrans.StatusIssue != StatusIssue::Picked && InventTrans.StatusIssue != StatusIssue::ReservOrdered && InventTrans.StatusIssue != StatusIssue::ReservPhysical && InventTrans.StatusIssue != StatusIssue::QuotationIssue && InventTrans.StatusReceipt != StatusReceipt::Registered && InventTrans.StatusReceipt != StatusReceipt::Arrived && InventTrans.StatusReceipt != StatusReceipt::QuotationReceipt && InventTrans.StatusReceipt != StatusReceipt::Ordered && InventTrans.PackingSlipReturned == 0 JOIN inventDimTbl WHERE inventDimTbl.InventDimId == inventTrans.InventDimId && (isLocationSpecified == true && inventDimTbl.InventLocationId LIKE inventLocationId || isLocationSpecified == false) && (isBaileeSpecified == true && inventDimTbl.InChargeId_RU LIKE baileeId || isBaileeSpecified == false) JOIN ItemName, NameAlias, ItemGroupId FROM inventTable GROUP BY ItemName, NameAlias, ItemGroupId WHERE inventTrans.ItemId == inventTable.ItemId && (isBuyerGroup == true && inventTable.ItemBuyerGroupId LIKE BuyerGroup || isBuyerGroup == false) JOIN UnitId FROM inventTableModule GROUP BY UnitId WHERE inventTrans.ItemId == inventTableModule.ItemId && inventTableModule.ModuleType == ModuleInventPurchSales::Invent результат правильный . Пытаюсь связать с таблицей PurchLine , добавляю к вышеуказанному запросу следующее : ............................... JOIN dimension PurchLine GROUP BY dimension WHERE PurchLine.InventTransId == inventTrans.InventTransId && PurchLine.ItemId == inventTrans.ItemId т.е я хочу подвязать к основному запросу PurchLine, и брать оттуда dimension , и только для тех itemId , которые вышли в основном запросе . Однако в результате я получаю какие то левые строки. Скажите правильно ли я делаю. Может все таки надо связывать как то иначе?  | 
| 
	
 | 
| 
	
	 | 
	
			 
			Похожие темы
		 | 
	||||
| Тема | Ответов | |||
| Связь VendInvoiceTrans и PurchLine | 17 | |||
| Query из 7 таблиц | 29 | |||
| Связь таблиц CustPackingSlipTrans и SalesLine | 4 | |||
| Невидимая связь двух таблиц в формах | 11 | |||
| Связь двух таблиц | 10 | |||
		
  |