on 12-11-2013 7:48 PM
Dear Experts,
Please tell me a query to get result Sales Invoice results as follows or sales recorded through Journal Vouchers sometimes. when an invoice is not created directly journal entry is posted in JDT1.
BP.NAME Jan Feb Mar April May June
Total at the bottom is also needed.
Regards,
Junaid
Hi Junaid,
Try:
SELECT P.CardName, [1] Jan, [2] Feb, [3] Mar, [4] Apr, [5] May, [6] Jun, [7] Jul, [8] Aug, [9] Sep, [10] Oct, [11] Nov, [12] Dec
FROM (SELECT T0.ShortName,T1.Cardname,
(T0.Debit-T0.Credit) AS AMOUNT, MONTH(T2.RefDate) Month FROM JDT1 T0 INNER JOIN OCRD T1 ON T1.CardCode = T0.Shortname
INNER JOIN OJDT T2 ON T2.TransID = T0.TransID AND T2.TransType in ('13','14','30')
WHERE T2.RefDate >='[%0]' AND T2.RefDate <='[%1]') S
PIVOT (SUM(AMOUNT) FOR month IN ( [1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12] ) ) P
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you please share me your Email id so that i can send the query to you.
Regards
Abuthahir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.