How to Show only One Credit Column at a time

Hi,
        This is the Query :- it displays  all the credit columns simultaneously
SELECT OINV.DocDate AS 'Posting date',
                      OCRD.GroupNum AS 'Payment Terms', OCRD.Balance AS 'Amount', OINV.DocTotal AS ' Debit Amount',
                      CASE WHEN OCRD.GroupNum = 7 THEN (OINV.DocTotal - OCRD.BALANCE) ELSE 0 END AS 'Credit 7',
                      CASE WHEN OCRD.GroupNum = 9 THEN (OINV.DocTotal - OCRD.BALANCE) ELSE 0 END AS 'Credi 9',
                      CASE WHEN OCRD.GroupNum = 5 THEN (OINV.DocTotal - OCRD.BALANCE) ELSE 0 END AS 'Credi 5',
OINV.DocDueDate AS 'Due date ',OINV.Address
FROM         OCRD INNER JOIN
                      OINV ON OINV.CardCode = OCRD.CardCode
WHERE (OINV.DocDate  BETWEEN '04/08/11' AND '06/09/11'  AND OINV.CardCode = 'C00356')
- it displays  all the credit columns simultaneously
i want if GroupNum =7 then ,it should display the data in Credit 7 Column and rest Credit 5 and Credit 9 should be hide (Credit 5 and Credit 9 columns should not be shown in the data)
Similarly, if GroupNum =5 then, it should display the data is Credit 5 Column and rest Credit 7 and Credit 9 should be hide
similarly for GroupNum =9.
Kindly give me the solution for this problem.
Regards
Rahul

Hi Rahul.....
Try this.....
SELECT OINV.DocDate AS 'Posting date',
OCRD.GroupNum AS 'Payment Terms', OCRD.Balance AS 'Amount', OINV.DocTotal AS ' Debit Amount',
(Case When OCRD.GroupNum=7 Then (OINV.DocTotal - OCRD.BALANCE)
Else
Case When OCRD.GroupNum=9 Then (OINV.DocTotal - OCRD.BALANCE)
Else
Case When OCRD.GroupNum=5 Then (OINV.DocTotal - OCRD.BALANCE)
Else 0
End End End) As 'Credit',
OINV.DocDueDate AS 'Due date ',OINV.Address
FROM OCRD INNER JOIN
OINV ON OINV.CardCode = OCRD.CardCode
WHERE (OINV.DocDate BETWEEN '04/08/11' AND '06/09/11' AND OINV.CardCode = 'C00356')
Regards,
Rahul

Similar Messages

  • How to show only one element in drop list(common VO)

    Hi All,
    I'm using 11g adf jdev.
    I have a common view object VO. In this VO one attribute is dropdown list , which i commonly used in some jsf pages .
    Now in one particular jsf page i want show only one element in the dropdown list .
    how can i handle with out distrib'g the common VO.
    THANKS IN ADVANCE

    BTW, why you want to display only one item in the list.
    If you are sure that the list will be having only one item, why don't you have it as inputText/outputText
    How do you filter out the item to be displayed in the list? If that filtering is done on listdatasource bound to the list, the list will automatically show only one item(i.e, the filtered item)
    HTH
    Sireesha

  • How to open only one web page at a time?

    I used to have it set so when I opened a new web page, the previous one closed. Now, nothing closes automatically and I have about 50 pages open that I have to close. How do I set it so that only one page opens at a time?

    HI Janice,
    You can use a keyboard shortcut to close all windows in Safari. CommandShiftW.
    To close one window, Command + W.
    Carolyn

  • How do I show only ONE iCal calendar at a time?

    I'm using iCal to manage several different calendars on different websites and also have different calendars of my own. Currently they all show in iCal and this is getting very difficult to manage. How do I adjust iCal to show only the events associated with one calendar, e.g. the calendar I have clicked on, rather than all of them? Do they all have to show?

    Thanks - that's better than nothing, but switching them off/ on is still a bit fiddly as I will want to update different calendars frequently.
    I was hoping that it would be possible to set it up to simply show the calendar you had clicked on on at the moment, and also to set a default set of calendars to be on as a group (i.e. those I use to organise my own time).
    With one click I could then go from my personal calendars to one used for an external website and back again.

  • How to make only one JFrame active at a time !!!

    Hy, I have created a JFrame and I have placed a
    JPanel in it. I also have a JButton "New" on the
    JPanel. When I click on the "New" Button, another JFrame
    appears. But I want ONLY one JFrame to be appeared
    at a time. That is when a JFrame appears on the JPanel,
    I should not be able to add another one.
    If it is not possible to do this with JFrame, then how to do
    it with a JDialog
    How to do this.
    thanks

    You can declare a boolean variable in your class and set it to true if you open a window. Next time when you click the NEW button, check whether that boolean value is true or false. If true then don't open a new window. Also when u close the frame window, set the boolean value to false.

  • How to use only one event case at a time??

    Using LabVIEW, using the event structure is it possible to have only one event case execute at a time. For example, having event case controlled by keyboard, and the other event case controlled by mouse (clicking buttons) and only one being able to execute, not simultaneously. I was considering using a switch of some sort, but each case does not have a "stop if true/false" so I am open to a new method or work around. I attached code. I do not want output to be able to be sent from the keyboard case and mouse case at the same time.
    Thanks,
    Andrew
    Attachments:
    WiFi Motor Control & Cam Stripped.vi ‏29 KB

    Ah, OK. all you need is to keep state in a shift register that ensures that all "key down/mouse down" events are discarded after each key down/mounse down event until a key up or mouse up (resp.) has occured.
    Overall, you code is still way to complicated for this simple task. For example, you could eliminate all these "select" primitives and place the approriate diagram constant inside the respective case. On the other hand it is too simplistic, because you would think that certain key combinations should be allowed concurrently (e.g. up and left).
    What does the receiver actually do with the codes? Do you have any documentation for this device?
    LabVIEW Champion . Do more with less code and in less time .

  • Html Widget Crashes. How to load only one html widget at a time?

    I have a bunch of html widgets which are just tab navigators with html pages inside of them. I must have about 20 of them , mostly leading to google image searches for common searches I tend to do in my work. Instead of constantly searching for these things on google I just click on the tab with the google search for say..."tree images".  Its very fast and effecient for me.
    The problem is now I have so many that it crashes photoshop, or crashes adobe configurator most of the time if I try to open the panel file. Im guessing that the panel I made tries to load all 20 google image searches at once, instead of only loading the page I click on one at a time. Is there anyway to stop configurator from loading my html widgets that arent clicked on ?

    Anyone?

  • Delete only one text message at a time w/o deleting entire conversation?

    Does anyone know how to delete only one text message at a time without having to delete the entire conversation? The only two options I get are "clear conversation" or "cancel."
    HP   Windows XP  

    That's the same option I get too. It seems to me I recall seeing somewhere that you could delete individual messages in a thread but I don't remember where.
    It seems silly to limit deletions to only the entire conversation since with most phones you can delete individual messages.

  • How to create a variance on data that exists iIn only one database column

    How to create a variance on data that exists iIn only one database column?
    I'm trying to create a calculation to show the difference between the budgets for two different years in a Discoverer crosstab query.
    I'm using the lag function to repeat the value of a column for the current year and the year before.

    Lag and lead seems to be the only choice and they work excellent. Checkout the new 10g Database features. There is new SQL modal clause which might give additional and powerful analytics but in this case lag and lead should be sufficient.
    regards
    http://www.infocaptor.com/workbook-dump.php

  • When I open up iphoto and click on the events tab then double click on an event, it used to show minis of all the photos in that event.  Now it shows only one photo at a time.  How do I get it back? Can you help?

    When I open up iphoto and click on the events tab then double click on an event, it used to show minis of all the photos in that event.  Now it shows only one photo at a time.  How do I get it back? Can you help?

    On the bottom bar of the window (on the left iPhoto 11, on the right in other versions) note the slider. Drag it left.
    Regards
    TD

  • How do you show only one caller's video display wi...

    How do you show only one caller's video output with four people sharing a video call? i.e. the call originator wants to show a DVD video on a TV screen and the other callers want to view the video on full screen not just one fourth of their screen.

    Thought I'd try this just in case they are stripping out attachments.
    Gary Grow
    6457 Audubon Sq Dr N
    Mobile, AL 36695
    Email: [email protected]
    Cell: (251) 422-8817
    The American Creed by William Tyler Paige
    I believe in the United States of America as a government of the people, by the people, for the people; whose just powers are derived from the consent of the governed, a democracy in a republic, a sovereign Nation of many sovereign States; a perfect union, one and inseparable; established upon those principles of freedom, equality, justice and humanity for which American patriots sacrificed their lives and fortunes. I therefore believe it is my duty to my country to love it, to support its Constitution, to obey its laws, to respect its flag, and to defend it against all enemies.

  • How to show only date in BO webi 3.1 text box

    how to show only date in BO webi 3.1 text box for e.g:-
    01/01/2005  (no time only date)

    hi,
    just check by which format your date is coming
    just create a one variable and check =UserResponse("Transaction Date From (mm/dd/yy)")
    if your output is in format of("mm/dd/yyyy hh:mm:ss a")
    then some format we have to write in todate syntax
    then your final formula for date would be
    =FormatDate(ToDate(UserResponse("Transaction Date From (mm/dd/yy)");"mm/dd/yyyy hh:mm:ss A");"dd/mm/yyyy")

  • All my saved layers disappeared. Shows only one locked black layer.with red sripes

    All my saved layers disappeared. Shows only one locked black layer.with red sripes

    Apple changed the save behaviour several times in the past few versions of MacOsX - there is a good article about this:
    http://www.macobserver.com/tmo/article/os-x-mountain-lion-how-apple-rescued-save-as
    The trouble is, you should (I know, not much of a help to you at this point) always create backups AND work with versions. So save many versions (x1, x1a, x2, x2a, etc), because when you work within one master file you run the risk of these type of accidents and there is always a tiny change your file becomes corrupt for some external reason. You never know. Disk space is cheap, losing your work is often a real hassle, and can become very problematic when dealing with clients.
    So, save many versions, and make backups of your work. And never NEVER open your original files in any other software - always use a duplicate. You never know what that software might do to your files.
    Anyway, have you tried searching for the file name on your mac? Maybe, just maybe there is a duplicate lying around somewhere with the layers intact.

  • I was trying to add an itunes library to my computer, and now my itunes library can not be found. An ipod can be synced with only one iTunes library at a time. How can I find my Itunes library, complete with playlists ?

    I was trying to add an itunes library to my computer, and now my itunes library can not be found. An ipod can be synced with only one iTunes library at a time. How can I find my Itunes library, complete with playlists ?

    I have the same problem too and tried alot of things like time zone , restarting or changing DNS of wifi connection to 8.8.8.8 still nothing happens .. !!
    iPhone 5s, iOS 8.3

  • HT204088 How how can I synch my ipod + iphone music to my new computer? I get the same error  "my ipod or iphone is synched with another itunes library.An Ipod can be synched with only one itunes library at a time. What would I like to do Erase and Synch

    How can I synch my ipod & iphone music (purchased from itunes on my old laptop) to my new laptop? I keep getting the same message on my itunes on my new laptop: " The ipod/Iphone is synched with another itunes library. An ipod/iphone can be synched with only one itunes library at a time. What would you like to do - Erase and Synch or Transfer Purchases?" What do I do?
    A couple of other items:
    1) I am guessing Apple does not keep a history of all my music purchases? As I did not have my entire library backed-up anywhere, and relying on the music I have on my ipod and my iphone as my only source of itunes music....I have lost over 500 songs!!!
    2) I used to have an Apple account under another account name, and since have switched to a new account name. Is there anyway to find the history of purchases from my old Apple account name and transfer these over to my new account name and onto my new laptop?
    I hope someone can help, I am having a very difficult time trying to obtain answers. Angie

    The iphone/ipod is NOT a storage/backup device.  Not maintaining a backup copy is a big mistake.
    You can transfer itunes purchases from your iphone/ipod to your computer:
    Authorize your computer for all accounts and then click  File>Transfer Purchases

Maybe you are looking for