Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>Vinod,
>
>It looks like there is no direct relation between Tr2 and GL Master except through Trans. Your SQL should give you the same name in the 4th and 8th columns. Does it?
>
>In order to get a different name in the 8th column you would need to
>
> USE GlMaster AGAIN ALIAS RelatedToTr2 IN 0
>
>then use
>
> RelatedToTr2.GLMST_NAME AS Tr2_GLMST_NAME
>
>for the 8th column, and include
>
> AND RelatedToTr2.SomeKey = TR2_SomeForeignKey
>
>in your WHERE clause.
>
>>I'm having 3 files :-
>>
>>1. GL Master - Having all the general Ledger codes
>>2. Trans - Having Debit Part of Entry - Parent of Tr2
>>3. Tr2 - Having Credit Part of entry - Child of Trans
>>
>>Both Trans and Tr2 are taking G/L Code, G/L Desc etc. from GL master, I'm using following SQl to generate report but it is not returning correct Glmst_name for tr2...
>>
>>SELE TRANS_VNO, TRANS_DATE, TRANS_CODEFK, GLMST_NAME, TRANS_PART, TRANS_AMT, ;
>>TR2_CODE, GLMST_NAME, TR2_PART, TR2_AMT ;
>>FROM ACTRANS, ACGLMST, ACTR2 WHERE TRANS_CODEFK=GLMST_CODEPK AND ;
>>TRANS_KEYPK=TR2_KEYFK
>>
>>Can somebody give me the correct sql to get the right Glmst name...
Thanks for the help... Its working...
But is it the only way to do it ?? I mean, isn't there any way that i can just get the correct result without using the file twice...
Pls advs...
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement