Skip to Content
author's profile photo Former Member
Former Member

Query for Comparative Sales Statement

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2013 at 08:04 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2013 at 05:08 AM

    Could you please share me your Email id so that i can send the query to you.

    Regards

    Abuthahir

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.