Wish to include Posting Periods rather than hard coded Dates

Hi Guys,
I have this query that I would like to have it look for the financial year based on the posting periods rather than hard code in the year - i.e 2011. The reason being that the financial year is from 1st October to 30th September, so my query below will not give me accurate information when going from December to January as the Year is Hard Coded in currently.
Does anyone have any ideas how I can achieve this, I must admit to be totaly stuck.
Kind regards
Sean
SELECT P.CardCode,P.CardName,
(SELECT SUM(Debit) - sum(Credit) FROM JDT1 WHERE ShortName= P.CardCode AND Year(DueDate) = 2011 AND TransType IN ('13','14')) '2011 Sales',
[1] as 'January',
[2] as 'February',
[3] as 'March',
[4] as 'April',
[5] as 'May',
[6] as 'June',
[7] as 'July',
[8] as 'August',
[9] as 'September',
[10] as 'October',
[11] as 'November',
[12] as 'December'
FROM (SELECT T0.CARDCODE, T0.CARDNAME, (T1.Debit - T1.Credit) AS BAL,
MONTH(T1.Duedate) as month
FROM dbo.OCRD T0
LEFT JOIN dbo.JDT1 T1 ON T1.ShortName = T0.CardCode AND Year(T1.Duedate) = 2011 AND T1.TransType in ('13','14')) S
PIVOT (SUM(S.BAL) FOR month IN
([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])) P

Hi Sean,
Even though it is possible to use variable for the report, I would suggest hard coded like this because you have different financial year with calendar year:
SELECT P.CardCode,P.CardName,
(SELECT SUM(Debit) - sum(Credit) FROM JDT1 WHERE ShortName= P.CardCode AND DueDate>= '10/01/2010' AND DueDate<= '09/30/2011' AND TransType IN ('13','14')) '2011 Sales',
[10] as '10-10',
[11] as '10-11',
[12] as '10-12',
[1] as 'January',
[2] as 'February',
[3] as 'March',
[4] as 'April',
[5] as 'May',
[6] as 'June',
[7] as 'July',
[8] as 'August',
[9] as 'September'
FROM (SELECT T0.CARDCODE, T0.CARDNAME, (T1.Debit - T1.Credit) AS BAL,
MONTH(T1.Duedate) as month
FROM dbo.OCRD T0
LEFT JOIN dbo.JDT1 T1 ON T1.ShortName = T0.CardCode AND T1.DueDate>= '10/01/2010' AND T1.DueDate<= '09/30/2011'  AND T1.TransType in ('13','14')) S
PIVOT (SUM(S.BAL) FOR month IN
([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])) P
Thanks,
Gordon

Similar Messages

  • Pop-up menu values from table cells rather than hard-coded?

    Hello,
    I'd like to have a pop-up menu that allows the user to select a category from the list. However, I want that list of categories to be dynamic. I have a table with all of my categories, and I want a pop-up menu that allows me to select one of the values in that table. I change "foo" to "bar" in the table containing the pop-up menu options, and I want the user only to be able to select "bar" in the pop-up menu (bonus points if all past instances of "foo" in the user-entered table are automatically changed to "bar" as well).
    While I'm at it, is there any way to have conditional formatting based on my dynamic categories? I.E. ROYGBIV color order for my categories corresponding to alphabetical order of categories, even though the category labels my change over time or some may be added or deleted.
    BTW, I have already downloaded the Numbers reference guide and formula guide.
    Any suggestions appreciated. Thanks very much,
    Adrian

    Question asked and responded many times :
    *_Feature unavailable_* .
    In several threads, Jerrold Green described a tip which may be used to mlimic this missing feature.
    You may use the Search tool :
    One returned link for the 90 days period.
    I checked, it's a good one.
    Yvan KOENIG (VALLAURIS, France) lundi 5 juillet 2010 19:19:21

  • I need any items added to a wish list to display alphabetically rather than randomly?

    I need any items added to a wish list to display alphabetically rather than randomly?

    If I want to carve off part of a library, I presume the way to do this is to make a copy of the library using PLM then go into iPhoto and delete what I don't want.  The result is the carved off portion.
    You don't need Library Manager to delete the portion you don't want.
    As a general rule: when deleting photos do them in batches of about 100 at a time. iPhoto can baulk at trashing large numbers at one go.
    If I want to merge two libraries, PLM implies that it will do this but will the Faces be merged too?
    I believe so.

  • How to print hard-coded data in multiple language in sapscript.

    Hi All,
    How to print hard-coded data in multiple language in sap-script, here the requirement is when printing the output
    we can see the window heading, description which are mostly hard-coded here I want to print these in both language as fallows,
    Goods to be delivered: = Morada de Entrega:
    Total net value excl. tax = Valor Total (IVA não Incluído)
    Description = Descrição
    Item = linha
    here I want to print in both languages like----       Goods to be delivered:/ Morada de Entrega:
    and the above headings in English are hard-coded.
    Kindly suggest me on this.
    Thanks in advance.
    Arun.

    Hi Arun,
    Use Standard text ade those text elements. Then use those in SAP script using different languages.
    Regards,
    Amitava

  • Posting period more than a month

    Hi Friends
    Normally we take each calender month as one posting period.
    But is it possible to have each 15days as one posting period. In this case for 12month calender fiscal year we should have 24 posting periods.
    Is it possible? if yes Pl let me know how?
    Thanks

    Hi,
    Yes you can do that. To achieve that please follow the following steps.
    1.     You create a Fiscal year variant with 24 posting. Through Tcode OB29.
    2.     Next create the following table
    Month     Day     Period     Year
    1     15     1     0
    1     31     2     0
    2     15     3     0
    2     29     4     0
    3     15     5     0
    3     31     6     0
    4     15     7     0
    4     30     8     0
    5     15     9     0
    5     31     10     0
    6     15     11     0
    6     30     12     0
    7     15     13     0
    7     31     14     0
    8     15     15     0
    8     31     16     0
    9     15     17     0
    9     30     18     0
    10     15     19     0
    10     31     20     0
    11     15     21     0
    11     30     22     0
    12     15     23     0
    12     31     24     0
    3. next same as you do normally

  • Hover Card is showing US formated date rather than UK formated date

    The HoverCard in the search results is showing the last modified date in US culture i.e. MMM/dd/yyyy rather than UK dd/MMM/YYYY. The culture of the search site collection is UK. 
    jamtoday

    When you say culture you mean locale? Might be worth re-checking the time / calendar options as sometimes switching the locale doesn't switch out the remainder of the options in that config page.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Posting period is showing in future date

    Hi,
    This is issue am facing in my IDES system.
    The error it is showing is as below:
    Posting only possible in periods 2015/03 and 2015/02 in company code z001  and message number M7053
    other inputs: MMRV :  Current peiod   : 03 2015
                                           Previous period: 03 2015
                                       Last period in previous .year 12 2014
    And one more input about this is, in my system  the system timing was showing 2011, this i did not recogbise, and when i tried to do the post goods issue(PGI) system shown some Posting error then i cloed the periods through MMPV t code, and closed upto 02 2015, then i reliazed why still system is allowoing to close the periods. then i checked the sytem timing and corrected it to current date.(13 th July 2014).
    In OB29 my Fiscal year variant is K4 (number of posting periods 12 and no of Special periods 4) is assigned to my company code z001 in t code ob37
    In OMSY "also showing the 2015 3
    Now even after changing the sytem date to correct date still system is showing the periods problem, when i tried to initialize the periods in t code MMPI sytem is showing the below message "Follow the instruction note 487381 before initialiazation"
    I found many treads similar to this issue, but all of them faced past date, needs to be closed the periods until current date, where as in my case the periods alredy open in future date.
    am not much familiar with this periods problem as am SD consultant.
    Please help to resolve this issue.
    thanks,

    Nobody needs help of an ABAPer to close or open periods, this is just normal customizing.
    Goto service.sap.com/notes and read the content of the OSS note mentioned in your message and just follow it, as it is the only way to run period initialization. It does not matter it you rolled it to far into the future or if you still have stone old periods like in the hundreds of other discussions on the same issue.
    And since this is that often discussed I am locking this thread.

  • Music Video displays wrong ARTWORK.  Displays a POSTER FRAME rather than the JPG that I have given it.

    I am using ITunes 11.05.5 on Windows 7 Professional.   Have thousands of videos ... MP4 Music Videos.   I make my own "ARTWORK" (on JPG per artist for all music videos by that artist).  I place the artwork in the file by "GET INFO", "ARTWORK", copy in my own JPG Image.    I confirm that there is only one image in the ARTWORK and that it is the correct image.   When I save and go back to the GET INFO everthing is fine.   When I view it in MS Explorer or in ID3-TAG the ARTWORK is also fine.   This process works fine for most everything but unexplainably fails and I can't fix it on certain occasions.   
    THE FAILURE:    Let me explain the problem that occurs on rare occasions (and once it occurs I can't ever fix it).   Lets say I have 5 music videos from the artist, John Jones.    I embed my own artwork (the same ARTWORK for all music videos from this same artist, John Jones) and all five videos group under the proper. same ARTWORK in the GRID VIEW.   Now, I obtain another music video from John Jones, once again I put the same ARTWORK on this file and now when I go into GRID VIEW it displays a POSTER FRAME (of that artist, John Jones) that I have never seen (although it must have come from the video since it is a POSTER FRAME of John Jones) .....  from that point on, all six music videos from John Jones also display that same ARTWORK (the wrong poster frame - but same poster frame for all John Jones music videos) even tho the first five were displaying properly before (but not longer).     It is as if a POSTER FRAME of John Jones is in cache and associated with the artist John Jones and can not be deleted.
    I have tried uninstalling and reinstalling ITunes, but it doesn't work.    I have tried deleting the new Music Video that I added and that started the problem (number six); hoping the the original five would return to nomal ...  but that does not work.
    Any suggestions would be appreciated.

    this one is actually a really rare symptom of a flaky connection to the ipod on a Windows PC. there's more going on in terms of hardware on nanos and 5th gens than in the earlier models ... so if the connection is flaky to precisely the right/wrong degree, itunes will see the ipod, but misidentify it as an earlier version of ipod.
    tracking down the cause of the flakiness can be tricky ... as you already know ...
    just checking. have you tried connecting with a different (known-good) USB cable? does that seem to have any impact on the rate of occurence of the problem?

  • SPD Current Item URL to include web address rather than host name

    Hi,
    When I dcreate an SPD list workflow and include a link to the current item URL the web address gets replaced with the hostname. For example:
    I expect to see:
    http://mycompany.com.au/sites/corp/xxx/Lists/MyRegister/DispForm.aspx?ID=12 
    but we get
    http://perspxxx99/sites/corp/xxx/Lists/MyRegister/DispForm.aspx?ID=12    (perspxx99
    is the hostname)
    If requierd I can craft the URL however wondering if there's a way to make the default point to the machine name.
    Many thanks,
    Marco

    Hi,
    Can you please confirm Alternate Access Mappings are correct as per this post?
    https://social.msdn.microsoft.com/Forums/en-US/2bb44216-a930-4786-ad0a-3505f0f7f1d4/sharepoint-2010-workflow-current-item-url-pointing-to-internal-server-name?forum=sharepointcustomizationprevious
    Thanks,
    Avni Bhatt
    If this helped you resolve your issue, please mark it Answered

  • Is there a way to view completed reminders by the lists view rather than all together date view?

    NM

    Not directly, as far as I can tell.
    You could create a new list, "Completed List", or something, then select all the reminders from the usual "Completed" list, copy (command-c) then paste (command-v) into "Completed List".

  • Is there any way to get iMessage to display the absolute date rather than the relative date of a text message?

    Sometimes I need to document when a text message exchange occurred and taking a screen capture is a nice and efficient way of doing this.  However, since iOS7, iMessage has used relative dates for recent text messages and will simply say "Today 1:31 PM" when I would prefer it if it said, "Wed, Nov 12, 1:31 PM".  I can reasonably figure out whether November 11 was "Yesterday" if need be.

    No.

  • Button on Form to Update a specific field with hard coded data

    Hi Guys,
    This will probably be a nice a simple issue for you guys, but I have ben struggling on how to do this for hours!
    On my form created by a report I have a field called status that is pulling the data from the order_status column contained in the customer_orders table.
    What I am looking to do is to create a button on the form that once clicked will change the order_status to "Complete" and update the customer_orders table.
    I have attempted to do this by creating the button and also a proccess on the page, and have assigned the button to the process
    I have set the process as PL/SQL and have entered the following code:
    BEGIN
    UPDATE customer_orders
    SET order_status='Complete'
    WHERE customer_order_id =:P7_customer_order_id;
    END;
    However when I click on the button, the page just refreshes and the field has not been amended!
    Please Help
    Thanks
    kev

    I don't know of any example apps containing that off-hand. I've done this sort of thing several times before, but also can't post them as-is on apex.oracle.com due to sensitivity.
    I can tell you the steps I would follow:
    1) Create a button - in a region position or among region items - doesn't matter. If doing it as a button in a region position it will submit as the button name; if doing it as a button among region items it will submit as the button label.
    2) Create a PL/SQL after-submit process (On Submit - After Computations and Validations). Put the PL/SQL code in for the process (your update code looked fine to me, syntax-wise at least). Continue on in the process wizard and when it gets to where it wants to know if there is a condition, see the dropdown When Button Pressed - you'll want to select the button from step 1.
    3) Then, depending on what you want it to do next you would provide a branch - it could be a branch back to the same page refreshing the data with the new status or move on to another page.
    Are these the steps you followed?
    Hope this helps,
    John

  • Scheduling opening and closing FI posting periods

    Hi,
    Could you please let me know if there is any program to schdule the opening and closing of FI posting periods, rather than doing it manually every month end.
    Thanks
    Uma

    Hi,
    I was at a customer who had multiple company codes and they had the business requirement of closing differenet types of accounts on different dates. For this I had got a program developed wherein the users had to mention the closing date and the account number. This program would run every day and if the current date is eqaul to the closing date in the program, system would execute transaction OB52 and close the corresponding account.
    Regards,
    Rohit

  • Posting periods and account segmentation

    the company has several suboffice/division, but they want all under one company in B1. also they receive some of they invoices 2 months lates. Data migration will go back 2 years. So what is best way to set up posting period and account segmentation.

    Hello,
    Take a look at this thread and copied to your notepad :
    Division in SAP Business One
    about how to create suboffice/division.
    The posting period can be created go back more than 1 years from now as long when performing data migration, do not forget to set the current period that match with your data dates. The invoices and other opening balances can be migrated using DTW templates.
    So, I suggest you could create posting period more than 2 years ago in the last time and create 2 segmented accounts consists of sub office and division beside natural account. E.g. :
    12111-01-02 : 12111 is natural account, 01 is suboffice code and 02 is division.
    Rgds,

  • Safari displays a .qfx file rather than writing it

    When I connect to my local bank and direct it to download my transactions record as a .qfx file, Safari displays the contents of the file on the window, rather than writing the data to a .qfx file. I do not see this behavior with FireFox. Java scripts are enabled.
    I'm running OSX 10.9 on a MacBook Pro.

    Hi guys
    Thanks for suggestions. Carolyn, I did as you suggested but didn't solve problem. KeeChan, as explained in original post, that is my usual fallback but not all web sites work like that. Try downloading Safari - right click (Ctrl Click) on download button and all you get is the "Download.png" image.
    I finally found the answer. A long time ago I had downloaded and used "SpeedDownload" and had deleted it. Somehow, some trace of the app was left behind and the mime association with dmg files was messed up.
    You can not get rid of Speed Download by throwing its files away or by using an app cleaner product. You MUST run the Speed Download installer program and select the "uninstall" option to remove it.
    My browsers now download dmg files correctly.

Maybe you are looking for