I'm not an expert on joins, but it seems to me you have limited the
InventDim select with locationId == ambar, which will then restrict the
selection in the InventTrans.

The join on InventJournalTable has no further restriction, so which
TransRefId from which InventTrans should be used to fetch the IJT?

Of course if you group by ItemId you cannot select the it.TransRefId
anyway, that is also true.  But then I don't know exactly what you are
trying to achieve...

I would probably start playing with nested while selects at this stage,
but as I say, I am no expert on joins...   

Jim

-----Urspr�ngliche Nachricht-----
Von: [email protected]
[mailto:[EMAIL PROTECTED] Im Auftrag von Cenk Ince
Gesendet: Mittwoch, 04. Mai 2005 18:18
An: [email protected]
Betreff: YNT: [development-axapta] select from inventtrans doesn't work

Hi;

I don't select transrefId, that is rigth but i don't select inventDimid
eigther!
And i'm able to select from inventDim. What is different?

Thanks.


________________________________

Kimden: [email protected] bu ki�inin yerine: Jim Dickie
G�nderilmi�: �ar 04.05.2005 16:52
Kime: [email protected]
Konu: AW: [development-axapta] select from inventtrans doesn't work



Hi,

you have not select it.TransRefId iin your select it statement, only
sum(Qty).

Mit freundlichen Gr�ssen / kind regards,
Jim Dickie,
Circon Circle Consulting GmbH,
F�rbergasse 13, A-6850 DORNBIRN
e-mail: [EMAIL PROTECTED]
phone: +43 (0)664 2337785

-----Urspr�ngliche Nachricht-----
Von: [email protected]
[mailto:[EMAIL PROTECTED] Im Auftrag von Cenk Ince
Gesendet: Dienstag, 03. Mai 2005 08:30
An: [email protected]
Betreff: [development-axapta] select from inventtrans doesn't work

Hi all;

I prepare a report that gives transfers to a inventlocation between
date1 and date2.
When i add a join at the and of the select (below in red) it doesn't
return any value.
With out red line it gives me sum of all transfers in inventtrans.
But i want to devide them according to their "journalnameid" field on
inventjournaltable.

Any idea?


real fason_Giris(Inventlocationid ambar, transdate d1,transdate d2)
{
    inventDim                           id;
    inventtrans                         it;
    inventTransposting                  itp;
    inventjournaltable                  ijt;
    ;
    id.InventLocationId                 = ambar;
    select sum(qty) from it index hint TransIdIdx group by itemid  where
it.ItemId == this.ItemId &&
                               it.TransType ==
inventtranstype::InventTransfer &&
                               (it.StatusReceipt ==
StatusReceipt::Received || it.StatusReceipt == StatusReceipt::Purchased)
&&
                               it.Direction == inventDirection::Receipt
// stok giri?i
                               join id where
                               it.inventDimId == id.inventDimId
                               && id.InventLocationId == ambar

                               join itp index hint ItemTypeDateIdx where
                               itp.ItemId == it.ItemId &&
                               itp.InventTransId          ==
it.InventTransId &&
                               itp.InventTransPostingType ==
InventTransPostingType::Physical &&
                               itp.Voucher              ==
it.VoucherPhysical &&
                               itp.TransDate >= d1 &&
                               itp.TransDate <= d2
                               join ijt where ijt.JournalId ==
it.TransRefId;
    return it.Qty;
}



[Non-text portions of this message have been removed]







Yahoo! Groups Links














Yahoo! Groups Links










[Non-text portions of this message have been removed]






Yahoo! Groups Links












Yahoo! Groups Links

Reply via email to