Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 7846

Query to generate all existing JE, including JE from JV

$
0
0

Hi,

 

Currently I used two separate query to generate the existing JE.

 

The first query will generate JE that created from JV.

The second query will generate JE that automatically created by systems, however it will only include partial JE created from JV.

At the end, I have to combine the result of both query.

 

Is there a way to combine both?

The result should show all existing JE either created from JV or by systems.

 

First Query:

 

SELECT T1.[Account],

T2.[AcctName],

T0.[Number],

T0.[BaseRef],

T1.[LineMemo],

T1.[Debit],

T1.[Credit],

T1.[FCCurrency],

T1.[FCDebit],

T1.[FCCredit],

T0.[TaxDate] AS "JE CREATE DATE",

T7.[DateID] AS "JV CREATE DATE",

T0.[RefDate] ,

T6.[Name],

T3.u_name [User Name],

T0.[Creator],

T0.[Approver]

FROM [OJDT] T0

INNER JOIN [JDT1]  T1 ON T0.TransId = T1.TransId

INNER JOIN [OACT]  T2 ON T1.Account = T2.AcctCode

INNER JOIN [OUSR] T3 on T0.usersign = T3.userid

INNER JOIN NNM1 T5 on T5.series=T0.series and T5.objectcode='30'

INNER JOIN OFPR T6 ON T0.FinncPriod = T6.AbsEntry

INNER JOIN OBTD T7 ON T0.BatchNum = T7.BatchNum

WHERE T0.[RefDate] >=[%0] AND  T0.[RefDate] <=[%1]

 

 

Second Query:

 

SELECT T1.[Account],

T2.[AcctName],

T0.[Number],

T0.[BaseRef],

T1.[LineMemo],

T1.[Debit],

T1.[Credit],

T1.[FCCurrency],

T1.[FCDebit],

T1.[FCCredit],

T0.[TaxDate] AS "JE CREATE DATE",

T0.[RefDate] ,

T6.[Name],

T3.u_name [User Name],

T0.[Creator],

T0.[Approver]

FROM [OJDT] T0

INNER JOIN [JDT1]  T1 ON T0.TransId = T1.TransId

INNER JOIN [OACT]  T2 ON T1.Account = T2.AcctCode

INNER JOIN [OUSR] T3 on T0.usersign = T3.userid

INNER JOIN NNM1 T5 on T5.series=T0.series and T5.objectcode='30'

INNER JOIN OFPR T6 ON T0.FinncPriod = T6.AbsEntry

WHERE T0.[RefDate] >=[%0] AND  T0.[RefDate] <=[%1]

 

Really appreciate the help.

 

Thanks


Viewing all articles
Browse latest Browse all 7846

Trending Articles