Показать сообщение отдельно
Старый 19.06.2017, 16:16   #5  
smailik is offline
smailik
Участник
Аватар для smailik
 
166 / 43 (2) +++
Регистрация: 10.04.2012
Адрес: Москва
Замена на inner join ничего не дала.
Текст запроса:
SELECT * FROM InventTransferTable WHERE ((ReceiveDate>={ts '2017-05-20 00:00:00.000'} AND ReceiveDate<={ts '2017-06-19 00:00:00.000'})) AND ((TransferStatus = 2)) AND ((InventLocationIdFrom = N'242')) JOIN * FROM InventTransferLine WHERE InventTransferTable.TransferId = InventTransferLine.TransferId JOIN * FROM InventTable WHERE InventTransferLine.ItemId = InventTable.ItemId JOIN * FROM InventLocation WHERE InventTransferTable.InventLocationIdFrom = InventLocation.InventLocationId JOIN * FROM InventLocation WHERE InventTransferTable.InventLocationIdTo = InventLocation.InventLocationId AND ((((InventLocation_1.InventLocationType == 8) || (InventLocation_2.InventLocationType == 8))))