Trying to query the transferred inventory from the other sites to the current site that I am in - need help


I am trying to query the transferred inventory data that has been transferred, say from site 1157 to site 1123 (the site I am in). I have come up with this query. I am looking at the data that it has returned but I just wanted to see if the query returns the correct results or am I missing something? I have the _itemId, _inventDim table buffer, InventTransType::InventTransfer, and the from and todate as parameters to this method.

qty getInventoryTransferedQty(ItemId _itemid,inventdim _inventDim, Inventtranstype _inventTransType,date asOndate2,date fromdate2)
    //InventJournalTable      inventJournalTable;
    //InventJournalTrans      inventJournalTrans;
    InventTrans             inventTrans;
    InventTransOrigin       inventTransOrigin;
    InventDim               inventdim2;

    select sum(Qty) from inventTrans  join InventTransOrigin  join inventdim2
                                              where inventTrans.ItemId == _itemid
                                              && inventTrans.DatePhysical >= fromdate2
                                              && InventTrans.DatePhysical <= asOndate2
                                              && inventTrans.InventTransOrigin == inventTransOrigin.recid
                                              && InventTransOrigin.ReferenceCategory == _inventTransType
                                              && inventTrans.InventDimId     == inventdim2.inventDimId
                                              && inventdim2.InventSiteId    != _inventdim.InventSiteId
                                              //&& inventdim2.InventLocationId== _inventdim.InventLocationId
                                              //&& inventdim2.inventDimId == _inventDim.inventDimId
                                              && inventdim2.configId        == _inventDim.configId
                                              && inventdim2.InventSizeId    == _inventDim.InventSizeId
                                              && inventdim2.InventColorId   == _inventdim.InventColorId
                                              && inventdim2.InventStyleId   == _inventdim.InventStyleId;