Howto set ranges between 2 columns

Hello
I've a table PPPV having two columns : DATE START & DATE END
I want to write SQL that will give user a range between these two columns .Which means he should give date start which would hit DATE START COLUMN and date end which would hit DATE END column and results between two dates will be populated.
Can anybody give me a sample SQL demo on it for understanding.
Regards
Fahad

with t as
select to_date('10-may-2008','dd-mon-yyyy') start_date,to_date('20-may-2008','dd-mon-yyyy') end_date from dual
select t.end_date - t.start_date from t;

Similar Messages

  • Setting the ALV Hierarchy tree with grid line between the columns and rows

    Hi Experts,
    I would like to ask if there is any suggestion on setting the ALV hierarchy tree to be separated by grid line between the columns and rows just like how it is display the same way in normal ALV grid.
    Thanks in advance.

    Hi Lin,
    The requirement which you have stated is not possible.
    Lin,
    Also i have a query regarding BADI ZME_PROCESS_REQ_CUST, which you had raised on SDN. You have marked the question as solved/answered.
    Changing the data of a customize field in purchase requisition
    Could you please let me know, the steps you did to update the screen fields through the BADI.
    I would really appreciate your reply, because i am facing exactly the same problem which you have mentioned.
    Thanks,
    Best regards,
    Prashant

  • Lines Between Report Columns in Purchase Order Report

    Hello All,
    I am working with the Oracle Purchasing Report called POXPRPOP.rdf. I am trying to add a black frame between each column in the report. Imagine in a purchase order where several columns of data that have a black line in between them. I have tried working with the expanding frame around the data fields of the report, changing the line color of these expanding frames to black. This didn’t work to give me lines in between the columns. I have been able to bring other graphical elements into the report so it is not a graphics problem at the UNIX environment.
    I am using Reports 6i and Running the report through Oracle Applications Concurrent manager.
    Thanks for any help,
    Bradley

    It seems like I might be able to put a line between the data fields and set it to expand with the repeating frame. Maybe this is this how it is done.
    Bradley

  • Calculated Date Range in Lookup Column

    I want to have a lookup column on a list called Report Week.  The report week is a date range between Sun and Sat.  I could easily make a column of ranges in a seperate list and then use it as a lookup but I am hoping for something more
    elegant.  What I envision is the user selecting the Date Range lookup in a list item and the date ranges shown are the previous, current and upcoming weeks.  So the dropdown list would look like this:
    09/20/14 - 09/26/14
    09/27/14 - 10/03/14
    10/04/14 - 10/10/14
    Can this be done w/out using .NET?  Thanks in advance.

    more or less, you need three calculated columns (well, you may be able to do it in just the one, but it'll be obnoxious to write the formulas)...
    - start date
      => DateAdd([date field], 0 - (dayofweek([datefield]))
            basically, subtract the day of week from the reference date... this should give you the sunday that starts the week
    - end date
      => DateAdd([date field], 7 - (dayofweek([datefield]))
            basically the same, except this adds the remaining number of days in the week, to give you the saturday that ends the week
    - range (description)
      => concatenate([start date], " - ", [end date])
    you may need to fiddle with the formulas a little bit... run them in excel to tweak them.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Set relation between list and document library?

    I have a requirement that I want to show pop up/ modal dialog when I click on list item column "upload/Edit" (in EditForm.aspx) . In Modal Dialog I have to show upload button and also existed items if any. Here the attachments will store into document
    library's folder .The list item ID should be the folder name in document library.
    How do I set relation between list and doc lib ?
    Appreciate if suggests any links.
    Thank you.

    Hi Saurav,
    pls check below
    What version of SharePoint 2010 "SP 2010 Foundation or SP 2010 Server" you need to have SP 2010 server and to have the "User Profile service application".
    How do you configure the "User Profile service application" did you add the "Social Tagging Database"
    Create, edit, or delete a User Profile service application (SharePoint Server 2010)" 
    http://technet.microsoft.com/en-us/library/ee721052.aspx
    When you access to "Application Management>Manage service applications>User Profile Service Application>Manage User Permissions" validate if the all authenticated users Group have the "use Social Features" checked.
    Also validate in Central Administration in Farm Features if you have social tags and notes activated.
    http://sharepoint.stackexchange.com/questions/17546/tagging-feature-not-working
    https://social.technet.microsoft.com/Forums/office/en-US/c11cda96-091b-4b96-91bc-ccd8000238f4/tags-and-notes-sharepoint-2010-not-visible?forum=sharepointadminprevious
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Remove 10 pixel gutter from between portlet columns

    Hello.
    We'd like to remove the 10px gutter from between the portlet columns. We've received advice about changing the UI code using UICI but we're concerned about upgrade-path stability. If any of that BEA base code changes, we're hosed.
    Ideas? Is there a config setting somewhere?
    TIA,
    Nic Johnson

    We Customized the source to do something similar to this.
    Created a new Class:
    public class PortalContentView : IView
    Here is the explanation:
    This code is a copy of MyPortalContentView. All the instances of MyPortalContentView was
    /// replaced with PortalContentView and public const int N_NARROW_COL_WIDTH = 250; was changed to
    /// public const int N_NARROW_COL_WIDTH = 160;
    /// This had to be done in order to change the constant value. It was not possible to inherit
    /// MyPortalContentView and override the Constant N_NARROW_COL_WIDTH
    We customized Column Width. I think you are looking for this one though:
    /// <summary>
              /// CUSTOMIZABLE - The width of the padding between portlet columns and between portlets.
              /// </summary>
              public const int N_PORTLET_PADDING = 10;
    Also this is the only way that I am aware of doin this. Changing teh portlet layout by changing the values BEA has in the Stylesheet doen't work. It's a bug according to BEA.

  • How to find differences between two columns

    Hello I need the formula to spot differences between two columns and to write on a third one if the same name appear on the two columns.
    For example:
    rome berlin true
    berlin moscow false
    chicago toronto true
    toronto chicago true
    florence
    Thanks
    Lorenzo

    You should be able to use COUNTIF where the range is th first column and the condition is the word in the second column. If the result is greater than zero then the word is in both columns.

  • How Can I set up a JTable columns?

    Dear All,
    How can I set up my JTable columns to have the amount the user specifies?
    for example when the user types in 50 in JTextField 1 I want the JTables columns to then set to 50.
    How can this be done?
    Thanks
    lol
    import javax.swing.*;
    import javax.swing.table.TableModel;
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class si1 extends javax.swing.JFrame implements ActionListener {
        JTextField name = new JTextField(15);
        JTextField name1 = new JTextField(15);
        public si1() {
            super("DataBase Loader");
            setSize(1025,740);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel pane = new JPanel();
            JPanel pane1 = new JPanel();
            JPanel pane2 = new JPanel();
            JPanel pane3 = new JPanel();
            JPanel pane4 = new JPanel();
            pane.setLayout(new GridLayout(20,1));
            pane1.setLayout(new BorderLayout());
            int j=10;
            String[][] data = new String[j][2];
            for (int k=0; k<j; k++){
               String[] row = {"",""};
               data[k] = row;
            String[] columnNames = {"First Name", "Last Name"};
            JTable perstab = new JTable(data, columnNames);
            perstab.setGridColor(Color.yellow);
            perstab.setPreferredScrollableViewportSize(new Dimension(500,500));
            JScrollPane scrollPane = new JScrollPane(perstab);
            pane1.add(new JPanel(), BorderLayout.EAST);
            JButton btn = new JButton("What are the names?");
            btn.addActionListener(this);
            btn.putClientProperty("DATABASE", perstab);
            pane1.add(new JPanel().add(btn), BorderLayout.SOUTH);
            pane2.add(name);
            pane3.add(name1);
            pane.add(pane2);
            pane.add(pane3);
            pane1.add(pane, BorderLayout.WEST);
            pane4.add(scrollPane);
            pane1.add(pane4, BorderLayout.CENTER);
            setContentPane(pane1);
            show();
        public static void main(String[] args) {
            si1 frame = new si1();
            frame.setVisible(true);
        public void actionPerformed(ActionEvent e) {
            JTable table = (JTable)((JButton)e.getSource()).getClientProperty("DATABASE");
            TableModel model = table.getModel();
            int count = model.getRowCount();
            String[] firstnames = new String[count];
            String[] lastnames = new String[count];
            for (int i=0; i < count; i++) {
               firstnames[i] = (String)model.getValueAt(i, 0);
                System.out.println("first name at row " + i + ": " + firstnames);
    lastnames[i] = (String)model.getValueAt(i, 1);
    System.out.println("lastname name at row " + i + ": " + lastnames[i]);

    As you can see I have tried this, but no success.
    If I am doing something wrong please accept my apology, and address me in the right direction.
    Thanks
    Lol
    import javax.swing.*;
    import javax.swing.table.TableModel;
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class si1 extends javax.swing.JFrame implements ActionListener {
        JTextField name = new JTextField(15);
        JTextField name1 = new JTextField(15);
        public si1() {
            super("DataBase Loader");
            setSize(1025,740);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel pane = new JPanel();
            JPanel pane1 = new JPanel();
            JPanel pane2 = new JPanel();
            JPanel pane3 = new JPanel();
            JPanel pane4 = new JPanel();
            pane.setLayout(new GridLayout(20,1));
            pane1.setLayout(new BorderLayout());
            int j=10;
            String[][] data = new String[j][2];
            for (int k=0; k<j; k++){
               String[] row = {"",""};
               data[k] = row;
            String[] columnNames = {"First Name", "Last Name"};
            JTable perstab = new JTable(data, columnNames);
         ((DefaultTableModel)perstab.getModel()).setColumnCount(Integer.parseInt(name.getText()));
            perstab.setGridColor(Color.yellow);
            perstab.setPreferredScrollableViewportSize(new Dimension(500,500));
            JScrollPane scrollPane = new JScrollPane(perstab);
            pane1.add(new JPanel(), BorderLayout.EAST);
            JButton btn = new JButton("What are the names?");
            btn.addActionListener(this);
            btn.putClientProperty("DATABASE", perstab);
            pane1.add(new JPanel().add(btn), BorderLayout.SOUTH);
            pane2.add(name);
            pane3.add(name1);
            pane.add(pane2);
            pane.add(pane3);
            pane1.add(pane, BorderLayout.WEST);
            pane4.add(scrollPane);
            pane1.add(pane4, BorderLayout.CENTER);
            setContentPane(pane1);
            show();
        public static void main(String[] args) {
            si1 frame = new si1();
            frame.setVisible(true);
        public void actionPerformed(ActionEvent e) {
            JTable table = (JTable)((JButton)e.getSource()).getClientProperty("DATABASE");
            TableModel model = table.getModel();
            int count = model.getRowCount();
            String[] firstnames = new String[count];
            String[] lastnames = new String[count];
            for (int i=0; i < count; i++) {
               firstnames[i] = (String)model.getValueAt(i, 0);
                System.out.println("first name at row " + i + ": " + firstnames);
    lastnames[i] = (String)model.getValueAt(i, 1);
    System.out.println("lastname name at row " + i + ": " + lastnames[i]);

  • How can I set up a 2 column layout in LiveCycle?

    Hi,
    I'm new to working with LiveCycle Designer. I'm using version 10.4, the OEM version bundled with SAP. Aside from being quite buggy, the capabilities seem pretty similar to LiveCycle Designer ES4, which I downloaded in a trial version. All of which is to say that this is a newbie question.
    I cannot, for the life of me, figure out how to set up a 2-column layout.
    On my master page, I have two content areas.
    When I create a new page, I am able to drag fields into the first content area I created, but not into the second content area.
    What am I doing wrong?
    Thanks,
    Janet

    Hi. 
    I am not a new LiveCycle Forms designer.  I am using Workbench ES2 (9.0.0.2.20121123.884160).  I have run into a new design problem related to a two column page. The business analytsts have designed the form in Word, where columns work great.  I have tried two subforms within the page. The problem with that is when the right column subform overflows, it overflows to the left column (as the left column has not overflowed), or when the left column overflows (whether or not the right column overflows) the right column begins on the left column's overflowed page.
    I have tried building a page with two side-by-side content areas in the Master Pages, including setting overflow parameters for each subform in the Design View, also with similar problems.
    I have tried using a table with no header and 1 row.  That one is interesting.  When only one cell overflows to another page, it works correctly.  When both columns overflow, the first text box in the subform in each cell is displayed at the top of the page and the remaining content of both cells overflow to the next page, leaving a nearly blank page containing only the one-line text label in each of the two columns.
    Is there some nearly hidden setting I am missing?  Is this possible within LiveCycle Designer Forms?
    Thanks for your attention to this request.
    Frank

  • Function Module for getting Number ranges between two number

    Hi guys,
    Is there any Function module which provide us the number range between two numbers?
    For Ex:If i give 1 and 10 to FM it must give me 1
    2
    3
    4.....upto 10.
    is there any FM for doing this,but i'm not able to find exact Fm for same.
    I can write small piece of code for getting number ranges, but if i get FM it could save little work.

    Hi
    But why do u need a fm, can't you do it by yourself?
    DATA: FROM_NUMBER TYPE I VALUE 1,
          TO_NUMBER   TYPE I VALUE 15.
    DATA: NUMBER            TYPE I.
    DATA: BEGIN OF T_NUMBER OCCURS 0,
                  NR TYPE I,
              END    OF T_NUMBER.
    NUMBER = FROM_NUMBER.
    DO.
      IF NUMBER <= TO_NUMBER.
        T_NUMBER-NR = NUMBER.
        APPEND T_NUMBER.
      ELSE.
        EXIT.
      ENDIF.
      NUMBER = NUMBER + 1.
    ENDDO.
    LOOP AT T_NUMBER.
      WRITE: / T_NUMBER-NR.
    ENDLOOP.
    Max

  • RANGE BETWEEN in SQL Server

    Hi All,
    I am trying to convert following Oracle query to SQL Server and having issues in defining calculation in the BETWEEN of the PARTITION.
    ORACLE Query:
    SELECT  
      head.acct_unit, head.company,head.role_id,    
       AVG(head.HEADCOUNT) over 
          (partition by head.acct_unit, head.company,head.role_id
           order by head.posting_month 
           range between  head.posting_month - trunc(head.posting_month,'YYYY') PRECEDING and current row)  YTD_HEADCOUNT
    FROM
    TABLE_A head
    SQL Server:
    SELECT  
      HEAD.ACCT_UNIT, HEAD.COMPANY,HEAD.ROLE_ID, 
      AVG(HEAD.HEADCOUNT) OVER 
          (PARTITION BY HEAD.ACCT_UNIT, HEAD.COMPANY,HEAD.ROLE_ID
           ORDER BY HEAD.POSTING_MONTH 
           -- RANGE BETWEEN DATEDIFF(dd,DATEADD(yy, DATEDIFF(yy,0,HEAD.POSTING_MONTH), 0),HEAD.POSTING_MONTH)
    PRECEDING AND CURRENT ROW
    FROM
    TABLE_A head
    Any help in this regard is highly appreciated.
    Regards,
    Shijith
    SE

    hi,
    when asking these kind of questions, you should provide a script to create an example table and data.
    I presume you want the range from the beginning of the year to the present record;
    if so, you could try this (again: I have no idea what datatype posting_month is, and how many records there are, and what you want to see)
    SELECT  
      HEAD.ACCT_UNIT, HEAD.COMPANY,HEAD.ROLE_ID, 
      AVG(HEAD.HEADCOUNT) OVER 
          (PARTITION BY HEAD.ACCT_UNIT, HEAD.COMPANY,HEAD.ROLE_ID
           ORDER BY HEAD.POSTING_MONTH 
           RANGE BETWEEN (DATEPART(mm,HEAD.POSTING_MONTH)) PRECEDING
    AND CURRENT ROW )
    FROM
    TABLE_A head
    Regards, Nico
    pdfaid, my blog

  • How to get the difference between two columns in a column group

    Hi All,
    My first time here and really new to programming. I would like to get the difference between 2 columns that are inside 
    a column group.
    Here is my sample table below: The Column Group is PeriodNumber and can only choose 2. like 1 and 2.. I would like to have a third row which will simply calculate the difference between the amounts in PeriodNumber 1 and 2.
                                PeriodNumber          
    Account                    1                            2     
    1) Cash                10,000                15,000
    2) Receivables      12,000                11,500
    3) Equipment          5,000                  5,500
    Total Assets          27,000                32,000

    Hi yabgestopa,
    From your description, you want to get the difference between two columns in a column group. After testing it in my environment, we can use custom code to achieve your requirement. For more details, you can refer to the following steps:
    Copy the custom code below and paste it to your report. (Right-click report>Report Properties>Code)
    Dim Shared Num1 As Integer
    Dim shared Num2 As Integer
    Public Function GetAmount(Amount as Integer, Type as String)
    If Type = "1" Then
    Num1=Amount
    Else
    Num2=Amount
    End If
    Return Amount
    End Function
    Public Function GetDif()
    Return Num1-Num2
    End function
    Right-click the second column to insert a third column with Outside Group-Right.
    Then use the expressions below in the matrix.
    =Code.GetAmount(Fields!Amount.Value,Fields!PeriodNumber.Value)
    =code.GetAmount(Sum(Fields!Amount.Value),Fields!PeriodNumber.Value)
    =Code.GetDif()
    The report looks like below.
    If you have any questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • I want to know the difference between Days column and Day1 Column

    Hi All,
    I used this query:
    SELECT to_char(return_date_time,'dd/mon/yyyy hh24:mi:ss') Test,
    DECODE ('I', 'I', DECODE (1, NULL, NULL, 0, NULL, SYSDATE + 1)) Days,
    DECODE ('I', 'I', SYSDATE + 1) Day1
    FROM fm_curr_locn
    WHERE patient_id = 'DU00002765'
    output: 
    Test
    Days
    Day1
    26/oct/2013 00:00:00
    26-OCT-13
    10/26/2013 3:06:59 PM
    I want to know the difference between Days column and Day1 column and why the days column didnt show the time
    Please anyone help.....
    Regards
    Shagar M

    Pleiadian wrote:
    It is the decode statement that is doing this.
    The format of decode is:
    decode(expression, search1, result1, search2, result2, searchn, resultn, default)
    All result fields must be of the same datatype and will be of the datatype of the first result (result1 in this example)
    In your example (the decode for the field Days) the first result is a NULL. I suspect (gurus? anyone?) that Oracle will use the varchar2 overload of the decode statement, and the date field will be converted to varchar2 using your NLS_DATE_FORMAT settings.
    In the second decode statment (Day1) the first result is of datatype date, so the result of the decode statement will be a date field (and will be parsed as such by your sql development tool)
    I agree, as NULL is the first result returned the datatype is undetermined, so Oracle is picking VARCHAR2 over others, and causing an implicit datatype conversion on the resultant date value, whereas the other which is returned as a date will use the local settings of the client tool being used.
    I can replicate the 'issue' in Toad, and it's rectified if we cast the first returned value of the decode statement...
    SELECT DECODE ('I', 'I', DECODE (1, NULL, CAST(NULL AS DATE), 0, NULL, SYSDATE + 1)) Days,
           DECODE ('I', 'I', SYSDATE + 1) Day1
    FROM dual

  • Find the difference between two columns in an ssrs matrix ? MSCRM

    Hi All,
    I am working in reporting part of our project (On-line MSCRM 2013) & in reporting services.
    I am trying to create report using fetch xml based. Below is the snap what we required the result.
    Kindly help me, how to get the difference in both column. (Its a matrix table where year is grouped).
    We need difference between both year Like (Plan Revenue of 2013 & Plan Revenue of 2014 difference in Plan Revenue Diff section) and same for Actual
    Revenue.
    https://social.microsoft.com/Forums/en-US/054d5ca4-0d38-4dc6-84a8-88866cc228fe/find-the-difference-between-two-columns-in-an-ssrs-matrix-mscrm?forum=crmdevelopment
    Thanks,
    Mohammad Sharique

    Hi Bro,
    I used parametrized option for year and done the report,Currently we are getting values in Difference column now i want to show
    that value in percentage. How can we show the percentage based on that value. Means i want to show the Difference in Percentage. 
    Kindly help me i tried but getting some issue. Below i am mentioning the code and snap with result.
    Below expression using to showing Plan Revenue in Percentage for year.
    =
    Sum(IIF(Fields!new_year.Value =Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))
    - Sum(IIF(Fields!new_year.Value =Parameters!EndYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))
    /IIF(Sum(IIF(Fields!new_year.Value = Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))>0,
    (Sum(IIF(Fields!new_year.Value = Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0))))
    ,1)
    )*100))
    Result issue is as below in snap with highlighted in red colour.
    Kindly help me on this issue also :)

  • Can we hide the lines between the columns and rows of an alv in wd abap

    HI all ,
      I know that we can colour cell/column/row in an alv in wd abap.
       but, can we hide the lines between the columns and rows of an alv in wd abap.
         i have checked this link [hiding lines b/n rows and columns of an  alv|http://help.sap.com/saphelp_nw04/helpdata/en/91/e7eb40c4f8712ae10000000a155106/content.htm]
         but didn't  understand, can please anybody provide some example or any material..? it will be very helpful.
                                                                         THANK  YOU.
    Edited by: arfat111 on Feb 15, 2010 7:05 AM

    Code some like this in the WDDOINIT method of your view which defines the ALV component as used component.
    instansiate the ALV component
    data lo_cmp_usage type ref to if_wd_component_usage.
    lo_cmp_usage = wd_this->wd_cpuse_usage_alv().
    if lo_cmp_usage->has_active_component() is initial.
       lo_cmp_usage->create_component().
    endif.
    data lo_interfacecontroller type ref to iwci_salv_wd_table.
    lo_interfacecontroller = wd_this->wd_cpifc_usage_alv().
    data lo_value type ref to cl_salv_wd_config_table.
    lo_value = lo_interfacecontroller->get_model().
    hide the grid lines
    lo_value->if_salv_wd_table_settings~SET_GRID_MODE( value = '01' ).
    Thanks,
    Abhishek

Maybe you are looking for

  • BO XI 3.1 installation and Upgrade activity Steps

    Hi Experts, Right now we are using BO XI R2 Version, Planning to uninstall XI R2 and do a fresh installation of BO XI 3.1 with SP3. Do I need to install the Java latest version for XI 3.1? Right now we have the following setting,          j2re1.4.2_0

  • Logic presets unavailable

    Hello So recently I was at a 1 to 1 appointment and was expeirementing with the strings presets in logic 9 (staccato, vabrato, etc) But when I went on my own computer the presets were not available or even located in my files or in logic. I was wonde

  • Related to addon

    how can we connect our application in vb.net with database to fetch data. Or let 1.)we have textboxes on form using screen painter 2.)and a table named usertable now fetch the data from table and show it in textboxes using user-id

  • Full HD LED for Probook 4530s

    hi there HP Support ,  i want to know that can we give a hardware  upgrade to Probook 4530s LED to a Full HD LED screen ?  Best Regards .

  • WCF Webservice With Acknowledgement

    Hi , I have  a requirement, where i need to expose a Webservice(WCF), when a request is made, it needs to send an acknowledgement back  "Yes i have received the request". Post which the caller can continue the work, as he is not expecting any respons