Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Sorting Query

Can we get this Query below to automatically be sorted by Posting Date?

SELECT T1.RefDate, SUM(T0.Debit - T0.Credit) as 'Net Balance'

from JDT1 T0

Inner Join OJDT T1 ON T1.TransId = T0.TransID and

(T1.TransType = '13' or T1.TransType = '14')

Inner Join OCRD T2 ON T2.CardCode = T0.ShortName

Where T1.RefDate Between '[%0]' and '[%1]' and T2.CardType = 'C'

Group by T1.RefDate

Thanks!!

Mike

Former Member
Former Member replied

Here you are:

SELECT T1.RefDate, SUM(T0.Debit - T0.Credit) as 'Net Balance' 
from JDT1 T0
Inner Join OJDT T1 ON T1.TransId = T0.TransID and
(T1.TransType = '13' or T1.TransType = '14')
Inner Join OCRD T2 ON T2.CardCode = T0.ShortName
Where T1.RefDate Between '[%0]' and '[%1]' and T2.CardType = 'C' 
Group by T1.RefDate
Order By T1.RefDate

Thanks,

Gordon

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question