Notifications
Clear all
Apr 28, 2023 7:44 am
Trong câu query bên dưới giả định công ty đang kích hoạt và sử dụng 2 dimension.
Dimension1: JDT1.ProfitCode
Dimension2: JDT1.OcrCode2
Dimension3: JDT1.OcrCode3
Dimension4: JDT1.OcrCode4
Dimension5: JDT1.OcrCode5
Trường hợp các bạn sử dụng nhiều hơn thì bổ sung thêm
select T0.TransId, T0.RefDate, T1.Debit, T1.Credit, T1.LineMemo, T1.ProfitCode, T1.OcrCode2 from OJDT T0 inner join JDT1 T1 on T0.TransId=T1.TransId inner join OACT T2 on T1.Account=T2.AcctCode where T2.Postable='Y' and T2.ActType in ('E','I') and (isnull(T1.ProfitCode,'')='' or isnull(T1.OcrCode2,'')='' ) and T0.RefDate >=[%0] and T0.RefDate<=[%1]