We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>


Looking For Something at vustudents.ning.com? Click Here to Search

DECLARE @D1 DATE

DECLARE @D2 DATE

SET @D1= '2019-1-1'

SET @D2= '2019-3-31'


select T0.BaseRef as 'Doc Num' ,T0.RefDate as 'Posting Date' ,T0.TaxDate as 'Document Date',T0.Ref2 as 'Ref No2.',

Account=(CASE WHEN T2.AcctName IS NULL THEN t3.Cardname else T2.AcctName end ),

T0.TransId,T3.CardName,

T1.Account as AccountCode,T1.BPLName as Branch,
SUM(T1.Debit) as 'Debit',SUM(T1.Credit) as 'Credit',
(SELECT SUM(t1.Debit) - SUM(t1.Credit) FROM JDT1 Where RefDate <= DATEADD (dd, -1, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()) +1, 0)) and Account = T1.Account Group by Account) AS 'Opening Balance',


t1.ShortName,
case
when T0.Memo like '%Outgoing Paymentst%' then
(select top 1 Comments from OVPM where docnum = T0.BaseRef)
when T0.Memo like '%A/P Invoices%' then
(select top 1 Comments from opch where docnum = T0.BaseRef)

else
T0.Memo

end as Particular,

case
when T0.Memo like '%Outgoing%' then
(select CardName from OVPM where docnum = T0.BaseRef)
when T0.Memo like '%A/P Invoices%' then
(select CardName from opch where docnum = T0.BaseRef)

else
T0.Memo

end as Vendor


from OJDT T0


inner join JDT1 T1 on T0.TransId =T1.TransId

inner join oact tr3 on tr3.AcctCode = T1.account

left outer Join OACT T2 ON T2.AcctCode=T1.ContraAct

left outer join OCRD t3 on t3.CardCode=T1.ShortName


where T0.RefDate>=@d1 and T0.RefDate<=@d2

Group By T0.BaseRef,T0.TransId ,T0.RefDate,T0.TaxDate,t1.Line_ID,T0.Ref2, T1.[ContraAct],Tr3.AcctName, T2.AcctName,t3.cardname,
T1.Account,T1.Debit, T1.Credit,T1.BPLName,t1.ShortName,T1.SYSCred,T0.Memo,t3.cardname


Order by T0.TransId


+ Click Here To Join also Our facebook study Group.


..How to Join Subject Study Groups & Get Helping Material?..


See Your Saved Posts Timeline

Views: 87

.

+ http://bit.ly/vucodes (Vu Study Groups By Subject Codes Wise)

Reply to This

Replies to This Discussion

Ya Asim Bajwa ka subject hy wo university min pechly 10 sal say yhi phara rha hy. jab online aye tu kanoo sy nap lena usy.

ho gya resolved issue thanks bro

Us k begir hi

Sir aap bhi kisi say kam nahi, sirf khud ko chuptay har jagah kabhi apni karmaat ki jhalak deikhyain tu sahi

khoubsorat code, masla kiya hay?

MAsla bht bra hai :P mat pouchooo   

Wesa ap k ati qury ??

bro meri qabliyat par shaq kar rahay?

Har kisam kay kaam kar laita mein

come ib ... 

mjhy tou smj hi ni aii

RSS

© 2019   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service