Please help with query for 5 lastest opening balance  !!!!!!!!!!!

Can anyone plese tell me or guide me how to write the query to show the 5 lastest opening balance from the A/R invoice on the specific BP partner?
Example
The box to input "BP partner"
and then show,
Lastest transaction | Ship date | Invoice number | Balance Amount | Culmulative
1    
2
3
4
5
Your help will be very very appreciated.

This is very good but I would like to show only the top 5 remaining invoice. I think that I have to combine it with JDT1. I have seen one query that may be able to apply on my case.
SELECT
T1.CardCode + '' AS 'BP Code',
T2.Notes2 AS 'BP Name',
T0.RefDate,
CASE
     WHEN T0.TransType = 13 THEN 'IN'
     WHEN T0.TransType = 14 THEN 'CN'
     WHEN T0.TransType = 30 THEN 'JE'
     WHEN T0.TransType = 24 THEN 'RC'
     WHEN T0.TransType = 46 THEN 'PS'
     ELSE 'Error ! ! !'
END AS 'Doc Type',
T0.Ref1 'Doc. Number',
ISNULL(T0.FCCurrency, ' - ') AS 'Ccy',
(T0.BalFcDeb - T0.BalFcCred) AS 'Bal. F. Ccy',
(T0.BalDueDeb - T0.BalDueCred) AS 'Bal. Rs',
ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate, '[%1]') <= -1)                     ,0) AS 'Future',
ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate, '[%1]') = 0)                         ,0) AS 'Current Mth',
ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate, '[%1]') = 1)                         ,0) AS '1 Mth Ago',
ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate, '[%1]') = 2)                         ,0) AS '2 Mth Ago',
ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate ,'[%1]') = 3)                         ,0) AS '3 Mth Ago',
ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate, '[%1]') between 4 and 6)    ,0) AS '4 - 6 Mth Ago',
ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate, '[%1]') >= 7)                       ,0) AS '>7 Mth Ago'
FROM JDT1 T0
INNER JOIN OCRD T1 ON T0.ShortName = T1.CardCode
LEFT OUTER JOIN OCPR T2 ON T1.CardCode = T2.Cardcode
LEFT OUTER JOIN OJDT T3 ON T0.TransID = T3.TransID
LEFT OUTER JOIN OINV  T4 ON T3.TransID = T4.TransID
LEFT OUTER JOIN ORIN  T5 ON T3.TransID = T5.TransID
WHERE
T1.CardType = 'C' and Balance != 0
and (T0.BalDueDeb - T0.BalDueCred) != 0
but still try to figure it out....

Similar Messages

  • Please help with "You can't open the application NovamediaDiskSupressor because PowerPC applications are no longer supported." I have seen other responses on this but am not a techie and would not know how to start with that solution.

    Please help with the message I am receving on startup ""You can't open the application NovamediaDiskSupressor because PowerPC applications are no longer supported."
    I have read some of the replies in the Apple Support Communities, but as I am no techie, I would have no idea how I would implement that solution.
    Please help with what I need to type, how, where, etc.
    Many thanks
    AppleSueIn HunterCreek

    I am afraid there is no solution.
    PowerPC refers to the processing chip used by Apple before they transferred to Intel chips. They are very different, and applications written only for PPC Macs cannot work on a Mac running Lion.
    You could contact the developers to see if they have an updated version in the pipeline.

  • Need help with query for converting columns to rows

    Hello,
    I know this is a very common question asked in the forum. I have searched regading this, i did find some threads, but i was not able to achieve what i require from the answers posted. So anybody please help me.
    I have a table which is having multiple columns as follows:
    Insert into table_1 (X,Y,Z,A,B,C,D,E,F,G,H,I) values (0,0,2,0,0,1,3,0,0,0,0,0);I want to convert the result into a two column, multiple rows i.e., I want the result as follows:
    Col1 Col2
    X      0
    Y     0
    Z      2
    A     0
    B     0
    C     1
    D     3
    E     0
    F     0
    G     0
    H     0
    I      0Please anybody help me in writing the query for this..

    Is this what you are expecting:
    SQL> WITH T AS
      2  (
      3  SELECT 0 X, 0 Y, 2 Z, 0 A, 0 B, 1 C, 3 D, 0 E, 0 F, 0 G, 0 H, 0 I FROM DUAL
      4  )
      5  SELECT  'X' col1, X col2 FROM T
      6  UNION ALL
      7  SELECT  'Y' col1, Y col2 FROM T
      8  UNION ALL
      9  SELECT  'Z' col1, Z col2 FROM T
    10  UNION ALL
    11  SELECT  'A' col1, A col2 FROM T
    12  UNION ALL
    13  SELECT  'B' col1, B col2 FROM T
    14  UNION ALL
    15  SELECT  'C' col1, C col2 FROM T
    16  UNION ALL
    17  SELECT  'D' col1, D col2 FROM T
    18  UNION ALL
    19  SELECT  'E' col1, E col2 FROM T
    20  UNION ALL
    21  SELECT  'F' col1, F col2 FROM T
    22  UNION ALL
    23  SELECT  'G' col1, G col2 FROM T
    24  UNION ALL
    25  SELECT  'H' col1, H col2 FROM T
    26  UNION ALL
    27  SELECT  'I' col1, I col2 FROM T
    28  /
    C       COL2                                                                   
    X          0                                                                   
    Y          0                                                                   
    Z          2                                                                   
    A          0                                                                   
    B          0                                                                   
    C          1                                                                   
    D          3                                                                   
    E          0                                                                   
    F          0                                                                   
    G          0                                                                   
    H          0                                                                   
    C       COL2                                                                   
    I          0                                                                   
    12 rows selected.

  • Please help with update for ios 8.1.3

    Some one PLEASE HELP ME!!!  I just updated my I phone 4s to ios 8.1.3 it was taking a long time then they finally updated and had the Hello screen after that I saw my photos then they would just delete it right in front of me I also lost some of my contacts but my notes still here can someone please help me find my photos are very important to me they have pictures of my relatives who passed away please help!!!

    After 4+ months of dealing with this data usage and battery drain problem that included 3 data captures of my wife's iMac, the trigger for us regarding the problems syncing with iCloud, and 5 hours of logs off my iPhone 6 to be analyzed by Apple engineers that included times my wife's computer was both on and off to demonstrate the difference in data usage and battery drain under those conditions, I can say with very reasonable certainty that the iOS 8.3 and corresponding Mac OS 10.10.3 update has solved the problem. 
    We have now been running for about 2 weeks and data usage with the iCloud Servers attempting to sync has dropped from a rate of 31 GBs to under 15 MBs per month.  Yes, you read it right.  We were burning 2000 times as much data doing absolutely nothing important on both of our phones, a 5s and a 6.  Just imagine what that does to battery life!  The 5s would last about 5 hours and the 6 was dead in less than 14.
    The distasteful aspect of this process was how the engineers were quietly fixing the problem at the same time sending messages to my contact person within Apple that were dismissive in nature in the face of indisputable unreasonable results. I must say, this experience with the multiple times the engineers' responses were inappropriate put a little tarnish on the old Apple shine of the ‘It just works’ mantra. This was my first experience in 34 years that caused me to stop recommending Apple products without reservations and with a disclaimer.
    Since the update solved the problem, then I can only conclude that there was a logic bug regarding the reaction within the process to the incoming data that was corrected.  There was noting short of logging out of iCloud that circumvented the problem for us, Gator5000e and probably many others noted on other threads.  I am not trying to imply that this is the cause of everyones battery use problem, but it is reasonable that it was a cause for many.

  • PLEASE HELP with Audio for YouTube!

    Hi,
    I KNOW YouTube is not the best for quality, but I absolutely HAVE TO post a couple of videos there!
    So.... having used Standard footage & the regular preset for DV-shot footage, does anyone KNOW which Encoding conversion to use (and I assume bitrate selection as well) that will allow me to post them on YouTube and actually hear something which even resembles the professionally Mastered recordings I am using.  So far I have tried WMV, h264 & a few others with various bitrates and most all of them sound horrible once YT converts them.  I was fine with the WMV video but the audio is way to disgusting to even listen to (especially compared to what the audio actually really is).  I have read some posts here suggesting FLV, WMV, etc, & I am truly at a loss and in major need of help here.  I have read Eddie's article link, & still the audio once YT does "it's thing" is ridiculous!
    The audio sounds great (good enough) on my computer after Encoder does its thing, but if anyone has encountered this and has the answer....PLEASE - what conversion & WHAT BITRATE should I use to make YT NOT ruin my recordings (and sound good on there)?!?!
    I even considered importing an already converted AAC or mp3 audio file into Pro, & then exporting it via Media Encoder but don't even think that's possible (or necessary).
    Please help as I HAVE to post it on YT yesterday already!
    As always, thank you for you help!!

    I never really had problems with sound quality on youtube...but I just use stereo pcm/wav mostly in editor. I think you should post what your using in your project and what you are exporting it as...cause its too vague to really give much specific advice re: helping you. also, say whether you have any sound codec packs or anything loaded...anything other than the original program codecs...and say what version of the product you are using...premiere pro what ??

  • Please help with script for right-mouse click on 3D objects

    Hi!
    I have PDF file with two simple 3d objects (for example with two cube).
    I need to make script that when user right-click to first cube, a PDF file (c:\a.pdf) opening (or c:\b.pdf for second one) in new windows. How to make it? Thank you so much!

    Hi,
    please check SDK sample 22 Right-Click, there is everything you need.
    First catch RightClickEvent, then create the menu entry when beforeAction = true, and when beforeAction = false you have to remove it again (otherwise you will receive an error when rightclicking again).
    Regards
    Sebastian

  • Please help with small but annoying 'Open With' finder problem

    hello, when I CTRL click a file in finder and select 'Open With' a huge list of apps appear and the same app apperars multiple times. e.g toast appears about 7 times Please have a look at the image below as a picture can say a 1000 words.
    [img]http://xs62.xs.to/pics/06016/toomanyapps.jpg.xs.jpg[/img]
    iMac G4 1.25ghz 20   Mac OS X (10.4.2)  

    You should be able to fix that by rebuilding the LaunchServices database.
    I use OnyX (Maintenance tab, Reset section).
    http://www.macupdate.com/info.php/id/11582

  • Please help with sizing for a canvas wrap

    I have looked at every video possible on this. I don't know what I am doing wrong?
    RIght now my image size in cs3 is
    60.2m
    5616x3744 in pixels
    18.72x12.48 in inches at 300 dpi
    I want to make my image capable of being a 36x24 inch gallery wrap. I realize I have to go into image size but when I raise it to a 36x24 my calculations go out the roof! Is that okay?
    222.5M
    10800x7200 pixels
    36x24 in inches at 300 dpi
    Can I send something that large to a printing lab?
    Sorry this is only my second time to do a gallery wrap and I am clueless about image size as far as measurements go!
    I do have a 5d mark2 shooting RAW always that should allow me to have an image size of this quality easily right?

    Grant
    That is exactly why I am posting this... I HAVE NO FREAKING CLUE that I can reduce the dpi and if so how low can I go with my image needing to be sized at 36x24? Sorry, I am really just kidding around! I am no computer whiz with digital stuff, my love is strictly photography. I am so scared I will loose the quality I don't want to make a wrong move. I don't even know if I am suppose to up my size that much. I know my camera is good, but when it spits out a size like 18x12 in cs3 how high can I size it up and drop the dpi before I loose quality? Is there some kind of chart for this?
    Thanks for your help!

  • Please help with snippet for form.

    I'm building my wedding photography site with iWeb and I want to place a form on there where customers can, via a series of pull down menus, choose various addons to their wedding package which I want to show a running total at the bottom for an instant quote. I would then need to get a copy of this data sent to me.
    What kind of HTML snippet would I need and where could I find one?
    Thanks in advance.

    Thanks Scott, that jot form looks great for a contact form etc. Due to being add free. But it doesn't look like it allows me to add a value to a selection on a drop down menu and a way of adding it up/displaying the total on my site.
    Example id need fields like this;
    "album required"
    The available selections could be:
    "12 x 8" value added to viable running total would be £100
    "14 x 10" value added to viable running total would be £150
    "16 x 12" value added to viable running total would be £200
    Then another field may be:
    "Hi Res CD required?"
    the available selections could be:
    "no thanks!" having a value of £0
    "50 images" having a value of £100
    "all images" having a value of £250
    So if the user chooses "16 x 12" and "all images" the running total on the page would show the user "£450"
    Any help would be greatly appreciated.
    Thanks!

  • Please help with script for 3D object

    Hi!
    I have PDF file with simple 3d object (for example a cube).
    I need to make script that when user right-click to this cube, some PDF file (c:\mypdf.pdf) opening in new windows. How to make it? Thank you so much!

    Hi!
    I have PDF file with simple 3d object (for example a cube).
    I need to make script that when user right-click to this cube, some PDF file (c:\mypdf.pdf) opening in new windows. How to make it? Thank you so much!

  • Please help with Specs for Elements 10

    Its been so difficult to get to the detailed specs for Elements 10
    Can anyone tell me if it does the following
    1. Import raw data from a Panasonic X5?
    2. Adjust vibrancy directly?
    3. Add starburst effect like in this photo
    Thanks

    See this Adobe document for the latest Adobe Camera RAW (ACR) update:
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5371
    The "ReadMe" link lists the supported cameras.  (The DMC-LX5 is supported.)
    Yes, a RAW file will open directly in ACR, and JPGs can be opened in ACR by using File...Open As.
    No.  You'll need to find a plug-in that does starbursts.
    Ken
    P.S.,  Barbara, once again, my slow typing did me in....

  • Please help with query

    Hello, I'm trying to write a query which is of the form below:
    select (aa.name || bb.name) full_name
    from
    (select * from per_positions where name = 'Igwe') aa,
    (select * from per_positions where name = 'OSHS.Application.Specialist.Head Office') bb
    There are two generated tables aa and bb. Sometimes aa and bb both return a value and sometimes only aa or only bb returns a value. So my question is, in a scenario where only of the inner tables returns a value, is it possible to make the other table return a null or blank value? In my case, when one of the tables doesn't return a value the entire record shows a null value. Thanks.

    user FULL JOIN
    SQL> with t
      2  as
      3  (select 'a' name from dual
      4  union all
      5  select 'b' name from dual
      6  )
      7  select aa.name||bb.name
      8    from (select name from t where name = 'a') aa
      9    full join (select name from t where name = 'b') bb
    10      on 1=1
    11  /
    AA
    ab
    SQL> with t
      2  as
      3  (select 'a' name from dual
      4  union all
      5  select 'b' name from dual
      6  )
      7  select aa.name||bb.name
      8    from (select name from t where name = 'a') aa
      9    full join (select name from t where name = 'x') bb
    10      on 1=1
    11  /
    AA
    a
    SQL> with t
      2  as
      3  (select 'a' name from dual
      4  union all
      5  select 'b' name from dual
      6  )
      7  select aa.name||bb.name
      8    from (select name from t where name = 'x') aa
      9    full join (select name from t where name = 'b') bb
    10      on 1=1
    11  /
    AA
    b

  • Please help with the FOR loop and the array..

    I was trying to place some words in the Movie Clip
    "TextPanel" and set a
    random position to each of them.
    But it's not working.
    1) I created a Movie Clip "word" and inside that MC I created
    a text field
    and gave it an identifier "textFiled".
    2) The linkage name for Movie Clip "word" I set to "word".
    3) In the actionscript I created an Array called "aWords".
    4) Then I created a FOR loop that should
    place (attach) Movie Clips "word0", "word1", "word2" and
    "word3" to the
    movie clip TextPanel, and set the textField text for each of
    them to the
    text from the Array.
    But the script attaches 4 Movie Clips with a name
    "Undefined", instead of 4
    different names (from the Array).
    What is wrong with this script?
    var aWords:Array = [apple,banana,orange,mango];
    for(i=0;i<aWords.length;i++){
    var v = TextPanel.attachMovie("word","word"+i,i);
    v.textFiled.text = aWords
    v._x = randomNumber(0,Stage.width);
    v._y = randomNumber(0,Stage.height);
    Thanks in advance

    But in my Post I already wrote v.textFiled.text = aWords
    so I don't understand what were you correcting..
    And one more:
    I have tested it by changing the
    v.textFiled.text = aWords; to v.textFiled.text = "some
    word";
    and it's working fine.
    So there is something wrong with the Array element, and I
    don't know why..
    "aniebel" <[email protected]> wrote in
    message
    news:ft2d5k$lld$[email protected]..
    > Change:
    > v.textFiled.text = aWords;
    >
    > to:
    > v.textFiled.text = aWords
    >
    > It needs to know which element inside the array you want
    to place in the
    > textfield (or textfiled) :)
    >
    > If that doesn't work, double check that your instance
    name is correct
    > inside
    > of "word".
    >

  • Need help with query for OITW

    I want to query a list that gives me all OnHand quantities for the Warehouses in one line per item:
    Item, Qty Whs1, Qty Whs2 ...
    Item1, Qty1_1, Qty1_2 ...
    Item2, Qty2_1, Qty2_2 ...
    Could somebody put me in the right direction?
    Thanks
    Franz

    Try this:
    SELECT P.Itemcode, T.ItemName,
    (Select U_NF_LagPlatz1 from OITW where WhsCode = 'NFE-1' and itemcode = T.Itemcode),
    (Select U_NF_LagPlatz2 from OITW where WhsCode = 'NFE-1' and itemcode = T.Itemcode),
        [NFE-1] AS Q1, [2] AS Q2, [3] AS Q3, [4] AS Q4,
        [5] AS Q5, [6] AS Q6, [7] AS Q7, [8] AS Q8,
        [9] AS Q9, [10] AS Q10
    FROM dbo.OITM T
    INNER JOIN
    (select Itemcode,OnHand, Whscode from oitw) s
    PIVOT
        sum(onhand)
        FOR whscode IN ([NFE-1],[2],[3],[4],[5],[6],[7],[8],[9],[10])
    ) p ON P.ItemCode = T.ItemCode
    ORDER BY P.[Itemcode]
    Regards,
    Bala
    Edited by: Balakumar Viswa on Jul 26, 2010 3:06 PM

  • Please help with code for a program

    Write a program which comutes the value of an investment over a 5 year period.The porgrm should display the value of an investment for each of the 5years were the initial investment and interest rate are to be specified by the user.It should compute and present value in the first year,compute and display value for the second year up to the last year(use a while or do...while loop).While there are more years to process ask the user for the next input,compute the value for the next year and output.

    jverd wrote:
    So what you're saying is that you're a lazy, stupid, unethical cheater and you want someone else to do your homework for you so that you can take credit you don't deserve and get a grade you didn't earn.
    Go to hell.But he's willing to pay big bucks (10 duke stars!) for this, so let's race to get those precious dukes.

Maybe you are looking for

  • Photo Library Indexes

    When I got started in IPhoto, I imported photos from an external drive. I then discovered the only way I could view the pictures was to make sure that drive was connected - which was fine (in my mind) because it took up less space on the internal HD.

  • FB03 unable to open attachment list

    Hi SAP members I got the issue in which for FB03 unable to open attachment as it was maintained in the respective table. Goto FB03 > ENVIRONMENT > ADDITIONAL ASSIGNMENTS > OBJECT LINKS and a popup appears in which attachment is available but double c

  • Whatsapp for my ipad mini with retina display?

    dear apple,              How To download whatsapp on my ipad mini with retina display?              Please do something for it.              please fix this problem as soon as possible.              PLEASE APPLE. Yours sincerely, ipad user

  • TS4148 my phone has no service

    My phone keeps showing No Service in the left hand top corner.  How do I fix this problem?

  • SD Reports-1

    Dear all, My customer wants the VA05 report such that their customer's PO no and Date also appears. Will it need some ABAP coding? OR is there any other way where we can use some T Code instead? Thanks in advance.