Derive Expire date value with the next high effective date next row - 1 day

Hi
Trying to fiind a way to derive a new date (EXPIRE_DATE) in a SQL query, the data is ordered by EFF_DATE, How do you derive EXPIRE_DATE column ...
Sample data:
ID_NO                EFF_DATE         EXPIRE_DATE
2004 02/03/2011 Null
3922 06/04/2010 01/03/2011
4454 20/06/2009 05/04/2010
4544 17/02/2008 19/06/2009
4232 13/07/2006 16/02/2008
Thanks
Qwestion

Give this a shot:
SELECT id_no
     , eff_date
     , LAG(eff_date) OVER (ORDER BY eff_date DESC) - 1  AS expire_date
FROM   table_x
ORDER BY eff_date DESC

Similar Messages

  • How to compare the date value with the date datatype column?

    Hi,
    I am executed a query to get output for the particular date in two different database.
    I got output in one db environment, but in the another environment i didnt get the output.
    APP_DECISION_DATE column contains date datatype
    ex:
    SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where APP_DECISION_DATE = TO_DATE('23-JAN-07',
    'DD-MON-YY'); 2
    DECISIONED_STAGE_ID DECISIONED_STAG
    2006060106 SYSTEM
    DATABASE - II
    SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where APP_DECISION_DATE=
    TO_DATE('31-JAN-2007','DD-MON-RRRR') and application_id=2007010028552;
    no rows selected
    in the same db i got the output while i used the TO_DATE(APP_DECISION_DATE)
    SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where TO_DATE(APP_DECISION_DATE)=
    TO_DATE('31-JAN-2007','DD-MON-YYYY') and application_id=2007010028552; 2
    DECISIONED_STAGE_ID DECISIONED_STAG
    2006060113 SYSTEM
    is it necessary to use TO_DATE function while i am using the data datatype column in the WHERE CLAUSE?
    Thanks in advance.
    siva

    Sorry & thanks sathish,
    Now i got the result.
    SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where APP_DECISION_DATE BETWEEN TO_DATE ('31.01.2007 00:00:00', 'DD.MM.YYYY HH24:MI:SS') AND TO_DATE ('31.01.2007 23:59:59', 'DD.MM.YYYY HH24:MI:SS')
    2 and application_id=2007010028552;
    DECISIONED_STAGE_ID DECISIONED_STAG
    2006060113 SYSTEM
    ================================
    But one doubt,
    When i created the column with the date datatype how it gets the time value,
    And in one environment db i got the result but in another environment i dont get,
    Shall i want to change any session status of date?

  • Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of '

    When I deploy the cube which is sitting on my PC (local) the following 4 errors come up:
    Error 1 The datasource , 'AdventureWorksDW', contains an ImpersonationMode that that is not supported for processing operations.  0 0 
    Error 2 Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of 'Adventure Works DW', Name of 'AdventureWorksDW'.  0 0 
    Error 3 Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of 'Customer', Name of 'Customer' was being processed.  0 0 
    Error 4 Errors in the OLAP storage engine: An error occurred while the 'Customer Alternate Key' attribute of the 'Customer' dimension from the 'Analysis Services Tutorial' database was being processed.  0 0 

    Sorry hit the wrong button there. That is not entire solution and setting it to default would work when using a single box and not in a distributed application solution. If you are creating the analysis database manually or using the wizard then you can
    set the impersonation to your heart content as long as the right permission has been set on the analysis server.
    In my case I was using MS Project Server 2010 to create the database in the OLAP configuration section. The situation is that the underlying build script has been configured to use the default setting which is the SQL Service account and this account does
    not have permission in Project Server I believe.
    Changing the account to match the Project service account allowed for a successful build \ creation of the database. My verdict is that this is a bug in Project Server because it needs to include the option to choose impersonation when creating the Database
    this way it will not use the default which led to my error in the first place. I do not think there is a one fix for all in relations to this problem it is an environment by environment issue and should be resolved as such. But the idea around fixing it is
    if you are using the SQL Analysis server service account as the account creating the database and cubes then default or service account is fine. If you are using a custom account then set that custom account in the impersonation details after you have granted
    it SQL analysis administrator role. You can remove that role after the DB is created and harden it by creating a role with administrative permissions.
    Hope this helps.

  • Apex flash charts with date values on the x axis

    I am playing around in Apex 4 using flash charts and having a bit of troubles playing with dates on the x axis on a 2d line chart.
    What I am trying to achive is a values plotted across the chart and the date/time values are not a constent (ie not continually say 1 hour apart) hence why I want to use a datatype of date.
    In the SQL below:
    select null as link,  sysdate -2  as value, 0 as label from dual
    union
    select null , sysdate -2+1/24 , 1 from dual
    union
    select null , sysdate -2+2/24 , 2 from dual
    union
    select null , sysdate -2+5/48, 1 from dual
    union
    select null , sysdate -2+3/24, 0 from dual;I get a 2D Line chart but each date/time value is equally space apart (ie sysdate -2, sysdate -2+1/24, sysdate -2+2/24 and sysdate -2+3/24 should be 1 unit apart and sysdate -2+5/48 should be half way between sysdate -2+2/24 and sysdate -2+3/24).
    I think I have to use custom xml. Using http://www.anychart.com/products/anychart/docs/xmlReference/index.html and http://www.anychart.com/products/anychart/docs/users-guide/DateTime-Axes.html I edited the XML and changed:
    <?xml version = "1.0" encoding="utf-8" standalone = "yes"?>
    <anychart>
      <settings>
        <animation enabled="false"/>
        <no_data show_waiting_animation="False">
          <label>
            <text></text>
            <font family="Verdana" bold="yes" size="10"/>
          </label>
        </no_data>
      </settings>
      <margin left="0" top="" right="0" bottom="0" />
      <charts>
        <chart plot_type="CategorizedVertical" name="chart_1614502819445708">
          <chart_settings>
            <title enabled="False" />
            <chart_background>
              <fill type="Solid" color="0xffffff" opacity="0" />
              <border enabled="false"/>
              <corners type="Square"/>
            </chart_background>
            <data_plot_background>
            </data_plot_background>
            <axes>
              <y_axis >
                <scale   mode="Normal"    />
                <title enabled="false" />
                <labels enabled="true" position="Outside">
                  <font family="Tahoma" size="10" color="0x" />
                  <format><![CDATA[{%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>
                </labels>
                <major_grid enabled="False"/>
    <minor_grid enabled="False"/>
              </y_axis>
              <x_axis>
                <scale  mode="Normal"    />
                <title enabled="false"/>
                <labels enabled="true" position="Outside">
                  <font family="Tahoma" size="10" color="0x" />
                  <format><![CDATA[{%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>
                </labels>
                <major_grid enabled="True" interlaced="false">
                    <line color="Black" />
                  </major_grid>
    <minor_grid enabled="True">
                  </minor_grid>
              </x_axis>
            </axes>
          </chart_settings>
          <data_plot_settings enable_3d_mode="false" >
            <line_series>
              <tooltip_settings enabled="true">
                <format><![CDATA[{%Name}{enabled:False} - {%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>
                <font family="Tahoma" size="10" color="0x" />
                  <position anchor="Float" valign="Top" padding="10" />
              </tooltip_settings>
              <label_settings enabled="true" mode="Outside" multi_line_align="Center">
                <format><![CDATA[{%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>
                <background enabled="false"/>
                <font family="Tahoma" size="10" color="0x" />
              </label_settings>
              <line_style>
                                <line enabled="true" thickness="1" opacity="1" />
              </line_style>
              <marker_settings enabled="True" >
                <marker type="Circle" />
              </marker_settings>
            </line_series>
          </data_plot_settings>
    #DATA#
        </chart>
      </charts>
    </anychart>to
    <?xml version = "1.0" encoding="utf-8" standalone = "yes"?>
    <anychart>
      <settings>
        <animation enabled="false"/>
        <no_data show_waiting_animation="False">
          <label>
            <text></text>
            <font family="Verdana" bold="yes" size="10"/>
          </label>
        </no_data>
        <locale>
          <date_time_format>
            <format>%HH:%mm:%ss %dd/%MM/%yyyy</format>
          </date_time_format>
        </locale>
      </settings>
      <margin left="0" top="" right="0" bottom="0" />
      <charts>
        <chart plot_type="CategorizedVertical" name="chart_1614502819445708">
          <chart_settings>
            <title enabled="False" />
            <chart_background>
              <fill type="Solid" color="0xffffff" opacity="0" />
              <border enabled="false"/>
              <corners type="Square"/>
            </chart_background>
            <data_plot_background>
            </data_plot_background>
            <axes>
              <y_axis >
                <scale   mode="Normal"    />
                <title enabled="false" />
                <labels enabled="true" position="Outside">
                  <font family="Tahoma" size="10" color="0x" />
                  <format><![CDATA[{%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>
                </labels>
                <major_grid enabled="False"/>
    <minor_grid enabled="False"/>
              </y_axis>
              <x_axis>
                <scale  mode="Normal" type="DateTime"    />
                <title enabled="false"/>
                <labels enabled="true" position="Outside">
                  <font family="Tahoma" size="10" color="0x" />
                  <format><![CDATA[{%Value}]]></format>
                </labels>
                <major_grid enabled="True" interlaced="false">
                    <line color="Black" />
                  </major_grid>
    <minor_grid enabled="True">
                  </minor_grid>
              </x_axis>
            </axes>
          </chart_settings>
          <data_plot_settings enable_3d_mode="false" >
            <line_series>
              <tooltip_settings enabled="true">
                <format><![CDATA[{%Name}{enabled:False} - {%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>
                <font family="Tahoma" size="10" color="0x" />
                  <position anchor="Float" valign="Top" padding="10" />
              </tooltip_settings>
              <label_settings enabled="true" mode="Outside" multi_line_align="Center">
                <format><![CDATA[{%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>
                <background enabled="false"/>
                <font family="Tahoma" size="10" color="0x" />
              </label_settings>
              <line_style>
                                <line enabled="true" thickness="1" opacity="1" />
              </line_style>
              <marker_settings enabled="True" >
                <marker type="Circle" />
              </marker_settings>
            </line_series>
          </data_plot_settings>
    #DATA#
        </chart>
      </charts>
    </anychart>and change the SQL series to:
    select link, to_char(value, 'HH24:MI:SS DD/MM/YYYY') as value, label from
    select null as link,  sysdate -2  as value, 0 as label from dual
    union
    select null , sysdate -2+1/24 , 1 from dual
    union
    select null , sysdate -2+2/24 , 2 from dual
    union
    select null , sysdate -2+5/48, 1 from dual
    union
    select null , sysdate -2+3/24, 0 from dual)But the chart changes from a line chart to a bar chart with each value being equally spaced.
    Can anyone see what I am doing wrong or point me in the right direction? Thanks in advance.

    This will be a little bit lengthy answer, but I guess it will be easier to understand what I meant to say.
    I created a table that contains values you used as a data source (just to make my life easier):
    SQL> alter session set nls_date_format = 'dd.mm.yyyy hh24:mi:ss';
    Session altered.
    SQL> select * from test;
    VALUE                    LABEL
    12.10.2010 09:03:45          0
    12.10.2010 10:03:45          1
    12.10.2010 11:03:45          2
    12.10.2010 11:33:45          1
    12.10.2010 12:03:45          0
    SQL> alter session set nls_date_format = 'hh24:mi';
    Session altered.From now on, we'll see only hours and minutes.
    Step 1: current and previous values - difference in number of MINUTES
    SQL> select t.value,
      2         lag(t.value) over (order by t.value) previous_value,
      3         (t.value - lag(t.value) over (order by t.value)) * 24 * 60 minutes_diff
      4  from test t;
    VALUE PREVI MINUTES_DIFF
    09:03
    10:03 09:03           60
    11:03 10:03           60
    11:33 11:03           30
    12:03 11:33           30Step 2: a little bit of calculation:
    - TIME_SPAN: how many minutes are there between MIN and MAX date?
    - MIN_DIFF: what is the minimum time difference (minutes)?
    - SLICES: how many time slices do we want on the x-axis?
    SQL> select
      2    min(x.value) min_val,
      3    max(x.value) max_val,
      4    min(x.minutes_diff) min_diff,
      5    (max(x.value) - min(x.value)) * 24 * 60 time_span,
      6    (max(x.value) - min(x.value)) * 24 * 60 / min(x.minutes_diff) slices
      7  from (select t.value,
      8               lag(t.value) over (order by t.value) previous_value,
      9               (t.value - lag(t.value) over (order by t.value)) * 24 * 60 minutes_diff
    10        from test t
    11       ) x;
    MIN_V MAX_V   MIN_DIFF  TIME_SPAN     SLICES
    09:03 12:03         30        180          6There's 180 minutes between 09:03 and 12:03; minimum time difference in our TEST table is 30 minutes, so - we want to have 6 time slices on the x-axis (180 / 30).
    Step 3: row generator technique: let's create time values that are missing:
    SQL> select y.min_val + (level - 1) * y.min_diff / (24 * 60) val
      2  from (select
      3          min(x.value) min_val,
      4          max(x.value) max_val,
      5          min(x.minutes_diff) min_diff,
      6          (max(x.value) - min(x.value)) * 24 * 60 time_span,
      7          (max(x.value) - min(x.value)) * 24 * 60 / min(x.minutes_diff) slices
      8        from (select t.value,
      9                     lag(t.value) over (order by t.value) previous_value,
    10                     (t.value - lag(t.value) over (order by t.value)) * 24 * 60 minutes_diff
    11              from test t
    12             ) x
    13       ) y
    14  connect by level <= y.slices + 1;
    VAL
    09:03
    09:33
    10:03
    10:33
    11:03
    11:33
    12:03
    7 rows selected.OK, now we have 30 minutes between every time value.
    Step 4: join newly generated time values with the original table. Use OUTER JOIN; missing labels will be 0 (zero):
    SQL> select
      2    null link,
      3    to_char(z.val, 'hh24:mi') new_value,
      4    nvl(t1.label, 0) new_label
      5  from (select y.min_val + (level - 1) * y.min_diff / (24 * 60) val
      6        from (select
      7                min(x.value) min_val,
      8                max(x.value) max_val,
      9                min(x.minutes_diff) min_diff,
    10                (max(x.value) - min(x.value)) * 24 * 60 time_span,
    11                (max(x.value) - min(x.value)) * 24 * 60 / min(x.minutes_diff) slices
    12              from (select t.value,
    13                           lag(t.value) over (order by t.value) previous_value,
    14                           (t.value - lag(t.value) over (order by t.value)) * 24 * 60 minutes_diff
    15                    from test t
    16                   ) x
    17             ) y
    18        connect by level <= y.slices + 1
    19       ) z,
    20       test t1
    21  where t1.value (+) = z.val
    22  order by z.val;
    L NEW_V  NEW_LABEL
      09:03          0
      09:33          0
      10:03          1
      10:33          0
      11:03          2
      11:33          1
      12:03          0
    7 rows selected.Cool, so we have them all. Now, go to Apex and create a chart using a query from step #4.
    I tested it - it displays something which means that it should work for you too (unfortunately, this forum doesn't accept attachments so that you could see it). Now, I can't tell whether that's what you need or not, but - if the idea itself is OK, it can be adjusted (I hope so).

  • Get the month from a date column with the calculated column

    I am trying to get the month from a date field with the help of calculated column. However I get this syntax error whenever I want to submit the formula:
    Error 
    The formula contains a syntax error or is not supported. 
    the default language of our site is German and [datum, von] is a date field.

    Hi,
    I have created two columns
    Current MM-YY
    Calculated (calculation based on other columns)
    Today
    Date and Time
    Current MM-YY is calculated value with formula as
    =TEXT(Today,"mmmm")
    But the output shows as December instead of May.
    I have tried =TEXT([Datum, von];"mmmm") but no help.
    I am trying to populated the column automatically with current month..ex: if its May the field should show May, next month it should show June an so on.
    Any kind help is grateful.
    Regards,
    Pradeep

  • Comparing the current value with the previous one in Powershell

    Hi,
    New to scripting and i was wondering how can I compare the current value with the previous value?
    I am having trouble with the loop structure, and I am not sure I am on the right track...
    I am trying to compare the record to next record in the same csv file after import-csv... My code runs fine, but is not giving the right result.
    $FilePath = Get-FileName -initialDirectory "C:\"
    #Testing for null
    If($FilePath)
    $Data = Import-csv -Path $FilePath | Sort-Object BUYER, {[int] $_.PO_NBR}, {[int] $_.LINE_NBR}
    Foreach($fData in $Data)
    $i = $fData
    Foreach($i in $fData)
    if($fData.Buyer -eq $i.Buyer)
    #save all the same buyer name to a new variable
    Write-Host "Same as previous"
    Else
    Write-Host "Variable is null"
    Remove-Item function:\Get-FileName

    Thank you. The Foreach loop is now working properly.
    Can I ask what is the purpose of "-ea 0" in the import-csv? I can't seem to find "-ea" as a parameter for import-csv in help.
    -ea is short for -ErrorAction.
    Don't retire TechNet! -
    (Don't give up yet - 13,225+ strong and growing)

  • Consolidation deletes values with the Flow_Type property "OPENING"

    Hello all,
    We have set up journals to populate a DataSrc dimension value with the following properties:
    COPYOPENING - BLANK
    DATASRC_TYPE - M
    IS_CONSOL - BLANK
    IS_CONVERTED - BLANK
    In other words, we do not do not want values in this data source to be picked up or in any way manipulated when we execute Consolidation (Stored Prodcedures SPCOPYOPENING, SPRUNCONVERSION,SPRUNCONSO).
    However whenever we execute consolidation the system delete some values in the above mentioned datasrc. Open further investigation, it seems to only delete values where the flow dimension value has the FLOW_TYPE - OPENING.
    Have you by any chance encountered this issue? Or do you have any ideas why this could occur?
    Thank you & regards
    Raja

    When I look to the SAP BPC MS V7.0 starter kit, I find the following differences :
    - they use NETVAR to the Variation flow
    - they call the Flow_type for CTA "TRANSDIF"
    - there is no TRANSLOPE
    I hope it helps

  • How to keep data integrity with the two business service in OSB 10.3.1.0

    How to keep data integrity with the two business service in OSB 10.3.1.0
    In our customer system, customer want to keep data integerity between two businness service. I thinks this is XA transaction issue.
    Basing customer requirment, I created a testcase but I can't keep data integerity, For detail information, please refer the attached docs.

    Can you please explain what you meant my data integrity in your use case?
    Manoj

  • How can I make the message date appear with the time for unread messages?

    Mail systems I am moving from display the date & time with the messages. I need this displayed to determine aging and importance of received mail. When archiving/saving old mail it helps filing mail off and not duplicate archived messages.

    Thunderbird displays time and date for all messages except for the present day messages. The time only is displayed for today and the date is appended at midnight.

  • Attaching a form component value with the link

    Help! Desperate!
    How do I attach list box value with the link. This is part of my code. I am struggling with the <a href part of the code. When the user clicks one of the options from the list box, that value should be attached to the link.
    private String getWageFooter(String rate)
    StringBuffer sb1 = new StringBuffer();
    String typerate=rate;
    sb1.append("<hr size=\"3\" width=\"550\">");
    sb1.append("<table width=\"950\"><tr><td align=\"center\">");
    sb1.append(" To change the Rate Type view");
    sb1.append("<p>Click on a Rate Type in this list and click the<I><b>");
    sb1.append("<font color=\"blue\">GO</font></b></I> button");
    sb1.append("<br><select name=\"ratetype\"><option value=\"\">Select One");
    sb1.append("<option value=\"All\">All Rate Types<option value=\"Hourly\">Hourly Wage");
    sb1.append("<option value=\"Annual\">Annual Wage</select>");
    sb1.append("<a href=\"occWageReport.jsp?typerate=");
    sb1.append("<img src=\"../images/go.gif\" border=\"0\"></a>");
    return sb1.toString();
    Sue

    Anybody! Any ideas how to attach the value of the item in the list box with the link as a querystring?
    Sue

  • Hey my iphone was working perfectly and then i sent it to check up and it came back with the itunes icon and data cable on it. so i tried plugging it in the computer and a message on itunes came up saying theres a problem with your phone. HELP PLEASE!!

    hey my iphone was working perfectly and then i sent it to check up and it came back with the itunes icon and data cable on it. so i tried plugging it in the computer and a message on itunes came up saying theres a problem with your phone and it may be damaged and cannot be activated. HELP PLEASE!!

    Why on earth send a Worning phone for service sounds like cutting up a Heaththy PET to see how it looks on the inside

  • In numbers 2 there was a "show search" which gave a list of all occurences of a value with the location. Does this exist in Numbers 3?

    in numbers 2 there was a "show search" which gave a list of all occurrences of a value with the location. Does this exist in Numbers 3?

    G.,
    The search results pane is gone in V3. If it's critical, stay in V2. I'm not being flippant, I have certain documents that I very carefully keep away from V3 because I don't want to give up the V2 features for those particular files. Some users have reported problems with having both versions active at the same time, so it's best to quit one before launching the other, but other than that you just need to be careful not to open your V2 documents with V3.
    Jerry

  • Only PSA with the 'Update subsequently in data targets'- BI 7.0

    Hello friends,
    We are currently on BI7.0 and my concern is with the InfoPackage Processing of 'Only PSA' with the 'Update subsequently in data targets'checked. When I load the data it loads into the PSA and I can see it in the monitor and in the Manage of the DSO it shows me Transferred '328' and Added Record '0'/. How do I manually update it from the PSA into the data target from this point?
    When I select  'PSA and then into Data Targets (package by package)' in the DSO manage screen it shows me Transferred 328 and Added Record '123'. So certainly that means that the data is not being subsequently loaded from the PSA when 'Only PSA' with the 'Update subsequently in data targets'checked option is used. Please tell me how to update data from PSA into Data Target when 'Only PSA' with the 'Update subsequently in data targets'checked is selected.
    Many thanks.

    Hi,
    In BW 3.x data flow, 'Only PSA' with the 'Update subsequently in data targets' option in Info package will load up to PSA only in case of the Process chains.
    After this info package we must add the additional step "Update from PSA to Target" in order to load to the target.
    Hope this will fix ur issue.

  • For the past five weeks, iCloud has not recognized my automatically downloaded song purchases as songs within iCloud. After the songs download, they appear with the ominous striked out cloud next to a duplicate with the download cloud.

    For the past five weeks, iCloud has not recognized my automatically downloaded song purchases as songs within iCloud. After the songs download, they appear with the ominous striked out cloud next to a duplicate song with download cloud. To get a fully functional song library that I can use to iCloud playlists and use all the other wonderful features of iCloud, I have to delete the automatic downloads and download the new version by clicking on the iCloud download icon. This is tedious. I have considered just turning off automatic downloads, but I rely heavily on my television shows downloading while I'm asleep and being ready to watch when I wake up.
    If anyone has a solution, I would greatly appreciate your help. I'm sure I did something to goof it up.
    Thanks,
    John

    Hi,
    I'm receiving the information that "No backups available.", but if i log in my icloud I find the backup.
    What can I do?

  • As to the data type of the data type of the difference between two date type of datas

    Hi,
    I have a question about the data type of the difference between two date type of datas.
    There are two date type of datas as:
    SSHIPMENTS.RECEIVEDATETIME
    SSHIPMENTS.PROMISEDATETIME
    I try to use the following SQL Script in Oracle SQL*Plus as:
    SELECT CASE
    WHEN (SSHIPMENTS.RECEIVEDATETIME - SSHIPMENTS.PROMISEDATETIME) < '000 01:00:00.000' THEN 'OnTime'
    WHEN (SSHIPMENTS.RECEIVEDATETIME - SSHIPMENTS.PROMISEDATETIME) < '000 01:30:00.000' THEN '60-89 Minutes'
    ELSE '3+ Hours'
    END
    FROM SSHIPMENTS;
    The error message of "Invalid Number" for the '000 01:30:00.000' happens.
    I don't know if the data type of the interval is wrong.
    Many Thanks,
    Cathy

    SELECT CASE
    WHEN (to_char(SSHIPMENTS.RECEIVEDATETIME,'hhmiss') - to_char(SSHIPMENTS.PROMISEDATETIME,'hh24miss')) < '010000' THEN 'OnTime'
    WHEN (to_char(SSHIPMENTS.RECEIVEDATETIME,'hhmiss') - to_char(SSHIPMENTS.PROMISEDATETIME,'hh24miss'))< '000 01:30:00.000' THEN '60-89 Minutes'
    ELSE '3+ Hours'
    END
    FROM SSHIPMENTS;
    just try it out..

Maybe you are looking for

  • How can i convert a window media player file into a format playable on ipod

    hey guys can you tell me how can i convert an widdow media player file into a format that can be played on my ipod, i used videora ipod converter but it can't convert the window media player file

  • Partitioning and Repartitioning in BI 7.0 Version

    Hi BI Gurus, Created one Cube for PCA , In this cube having time characterings are Fiscal year- period 0FISCPER , Fiscal year variant - 0FISCVARNT, Fiscal year - 0FISCYEAR and Posting period - 0FISCPER3 My Question  is I am planning to do Partitionin

  • Left Outer Join & IS NULL Not Working

    In a Data Flow Query element I am using a Left Outer Join to correlate two tables. In order to eliminate rows in which the Left Outer Join found a match with the Right table I am using IS NULL in the Where clause. Unfortunately IS NULL doesn't seem t

  • Need link to WRT16Nv2 Firmware version 11 please.

    I recently purchased a WRT160Nv2 router with firmware version 11. I had it configured  to allow remote desktop connection to any of the 3 PCs. PC1 3389 (External) to 3389 (Internal) on IP aaa.aaa.aaa.aaa PC2 3390 (External) to 3389 (Internal) on IP b

  • LAYOUT tab error in WEBDYNPRO

    Hi, When i click layout tab in webdynpro [ECC 6.0], it says the page can't be displayed. I tried all the solutions available in the forum before posting this... I enter my server host name and IP address  in the host file (C:\WINDOWS\system32\drivers