Year function reteives different values

SELECT year(convert(date,'24-10-49',5)) --dd-mm-yy
--2049
SELECT year(convert(varchar(10),'24-10-49',5)) --dd-mm-yy
--2049
SELECT year(convert(date,'24-10-50',5)) --dd-mm-yy
--1950
SELECT year(convert(varchar(10),'24-10-50',5)) --dd-mm-yy
--1950
Do we have any range for year function or do SQL server shows values to only limited period??

Hello Vishal,
That depends on the "Two Digit Year Cutoff" of the SQL Server Setting, see
http://msdn.microsoft.com/en-us/library/ms191004.aspx
Olaf Helper
[ Blog] [ Xing] [ MVP]

Similar Messages

  • Nesting of AGO or TODATE functions with differing level arguments is not supported

    I have a column in BMM which calculates the Year-To-Date Sales. This function uses the ToDate function to caculate the YTD.
    I need to develop another formula column which shows the last-year's YTD.
    I develop this formula in BMM by AGO on the YTD column which already uses a ToDate function.
    In BI Answers when selecting this column, results in the below message:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 22044] Nesting of AGO or TODATE functions with differing level arguments is not supported. (HY000)

    To reply to my own question. It appears I got it working, that is, the error message problem is solved, but I still have questions on how to use these functions.
    To get it to work, I added the primary key D_TIJD.TIJDKEY at the level of the lowest grain in my dimension (level tab).
    What I still wonder is how to make it select the right values. I have the following hierarchy: bookyear - bookperiod - week. A bookperiod contains 4 or 5 weeks (4,4,5 in a quarter), so 12 periods in one year. I defined a measure at period level and another at that level with the ago function, that should return the figures for that same period of the year before. My first question is, whether to go back 12 periods or 52 weeks (which is the lowest grain in my dimension)?
    The second question is how to use a combination of TODATE and AGO so that if I calculate the current period (of which only 2 weeks are passed), I also only want to include the same two weeks for that period one year ago in order to make a correct comparison. How do I do that???

  • MB5B & MRN9 Report showing different values

    Hi All,
    I am facing a problem when i am running MB5B & MRN9 report on back date, In both the reports stock is displaying correct but there is some difference in value. Material is managed by moving average price. Please provide your valuable inputs.
    Thanks
    Rashid

    hello !
    The transaction MRN9 is not designed to display the stock quantities and values for each date in a month. The transaction MRN9 only displays the quantity and value to the 'period end' which refers to entered field 'key date' or displays the actual quantity and value if the 'key date' refers to actual period. These data are selected from database tables MBEW (actual) or MBEWH (historical periods).
    If you will get the quantities and values for a special date (not a period end) you should use transaction MB5B which is additional selecting the documents posted until 'selection date' with option 'valuated stock'= 'X'.
    The transaction MRN9 provides a comparision of stock values for a selected period end with the values according to 'new calculated price' from functions 'determine lowest value' or 'FIFO-price' and is calculating the 'devaluation value'. This devaluation is normaly done only for a period end date(especially at end of fiscal year).
    If your are using the function of 'determine lowest value' (transactions MRN0, MRN1, MRN2, or function 'FIFO-valuation' (transaction MRF1) you can store the calculated 'lowest price' of 'FIFO-price' in one of available fields(tax price1-3, commercial price1-3) in material master. (please see also SAP documentation).
    You can also see the notes for this as well.
    590699     MRN9 Connection to key date and stock data
    486442     Lowest value: Significance of key date
    I hope these informations will help to understand the functions of transaction MRN9.
    Good luck!
    Plauto

  • Different values in a list box for each row of the table control...

    Dear Experts,
    Is it possible to populate different values for each row in a listbox inside a table control ?
    Example,
    Row 1 in the the table contains A, B & C
    Row 2 in the same table contains C, D & E
    If yes, How?
    yes i am using
      call function 'VRM_SET_VALUES'
        exporting
          id     = i_name
          values = i_list.
    Thank you .
    Message was edited by:
            Kokwei Wong
    Message was edited by:
            Kokwei Wong

    Hi Wong,
    this is code example for listbox
    TYPE-POOLS vrm .
    DATA: lt_vrm_values TYPE TABLE OF vrm_value.
    DATA: wa_vrm_values TYPE vrm_value.
    PARAMETER p_list AS LISTBOX VISIBLE LENGTH 10.
    INITIALIZATION.
      wa_vrm_values-key = 'Key1'.
      wa_vrm_values-text = 'Value1'.
      APPEND wa_vrm_values TO lt_vrm_values.
      wa_vrm_values-key = 'Key2'.
      wa_vrm_values-text = 'Value2'.
      APPEND wa_vrm_values TO lt_vrm_values.
      wa_vrm_values-key = 'Key3'.
      wa_vrm_values-text = 'Value3'.
      APPEND wa_vrm_values TO lt_vrm_values.
    AT SELECTION-SCREEN OUTPUT.
      CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                id              = 'P_LIST'
                values          = lt_vrm_values
           EXCEPTIONS
                id_illegal_name = 1
                OTHERS          = 2.
      IF sy-subrc  0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    To fill it with data from DB, just do select in INITIALIZATION and put that values with same alghoritmus.
    Manas M.
    P.S.: This is very easy question, you should use search ...

  • Table control list box. different values in each row of the list box

    Hi all,
    i have a requirement to display text box in table control. Each row of list box should contain different values.
    i tried with the below code  but the values are not getting populated in list  box. please give your ideas.
    I tried with list box which is having same values in all rows, it is working fine.
    loop at itab.
    select vbeln from ZSD_PS_BLAWB into ZSD_PS_BLAWB-vbeln
    where BLAWBNO = itab-BLAWBNO and
    BLAWBDT = itab-BLAWBDT and
    CTRNO = itab-CTRNO.
    if sy-subrc = 0.
    index = 1.
    list3-key = index.
    list3-text = ZSD_PS_BLAWB-vbeln.
    append list3 to list2.
    index = index + 1.
    endif.
    endselect.
    clear index.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    ID = 'ITAB-VBELN'
    VALUES = list2
    EXCEPTIONS
    ID_ILLEGAL_NAME = 1
    OTHERS = 2
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    modify itab.
    endloop.
    Thanks in advance.

    Hi,
    this is code example for listbox
    TYPE-POOLS vrm .
    DATA: lt_vrm_values TYPE TABLE OF vrm_value.
    DATA: wa_vrm_values TYPE vrm_value.
    PARAMETER p_list AS LISTBOX VISIBLE LENGTH 10.
    INITIALIZATION.
      wa_vrm_values-key = 'Key1'.
      wa_vrm_values-text = 'Value1'.
      APPEND wa_vrm_values TO lt_vrm_values.
      wa_vrm_values-key = 'Key2'.
      wa_vrm_values-text = 'Value2'.
      APPEND wa_vrm_values TO lt_vrm_values.
      wa_vrm_values-key = 'Key3'.
      wa_vrm_values-text = 'Value3'.
      APPEND wa_vrm_values TO lt_vrm_values.
    AT SELECTION-SCREEN OUTPUT.
      CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                id              = 'P_LIST'
                values          = lt_vrm_values
           EXCEPTIONS
                id_illegal_name = 1
                OTHERS          = 2.
      IF sy-subrc  0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    To fill it with data from DB, just do select in INITIALIZATION and put that values with same alghoritmus.
    Manas M.
    P.S.: This is very easy question, you should use search ...

  • How to input different values without logging out everytime in OATS

    Hi,
    I am new to OATS. I was trying the functional testing of a web application. For this I recorded it by first logged in the application then input some values in a field, submit it and logout.Then i tried to iterate it with different values in the input field, but the problem was that for every iteration it was logging in every time. How can i stop logging in everytime and put the values all in one login. Also can anyone provide me online tutorial for OpenScript used in OATS.
    Edited by: user13268396 on Jul 6, 2011 3:36 AM

    Hi,
    If you go to
    http://www.oracle.com/technetwork/oem/downloads/index-084446.html
    There is a section for Documentation download. Within this there is the OpenScriptUserGuide.pdf, with full explanations of the technology.
    For the iteration with out logging again you have to insert "for" loop.
    Regards,
    Srinivas

  • F.16 showing different values.

    Hi All,
    As year end activity, when running F.16 in test run, we are getting different values as compared to FS10N. Carry Forward balances are not matching for year 2011. Any idea what can be the possible reason for that?
    Parul

    F.16 balances should tally with FS10N
    First execute the F.16, there is no harm to execute this transaction.
    Also make sure which GL account you are checking in FS10N
    Rgds
    Murali. N

  • Mdx error : Query (11, 9) Two sets specified in the function have different dimensionality.

    Hi all
    i am getting the fallowing error for the below mdx , what may be the issue?
    Query (11, 9) Two sets specified in the function have different dimensionality.
    WITH SET LastSample AS TAIL(NONEMPTY([Date].[Hierarchy].members *[Time].[Hierarchy].members,[Measures].[Overall LU SR]))
    MEMBER [KPI Name] AS "Overall LU SR"
    MEMBER [KPI Value] As KPIValue("Overall LU SR")
    MEMBER [KPI Status] AS KPIStatus("Overall LU SR")
    MEMBER ObjectName as "Overall LU SR"
    MEMBER [Critical Threshold] as  [KPI Thresholds].[Threshold1].&[Overall LU SR].member_value
    MEMBER [Major Threshold] AS  [KPI Thresholds].[Threshold2].&[Overall LU SR].member_value
    MEMBER [Minor Threshold] AS 0
    MEMBER latestDate as [Date].[Hierarchy].membervalue, format_string = 'mm/dd/YYYY'
    MEMBER latestTime as [Time].[Hierarchy].member_caption
    SELECT  {latestDate,latestTime,ObjectName, [KPI Name], [KPI Value],[KPI Status],[Measures].[Critical Threshold],[Measures].[Major Threshold],[Measures].[Minor Threshold]} ON COLUMNS
    ,nonempty(LastSample) ON ROWS
    FROM [DRA]
    Surendra Thota

    hi all
    i got the solution . i have add measures dimension to the name  ie ,[Measures].[KPI Name],
    WITH SET LastSample AS TAIL(NONEMPTY([Date].[Hierarchy].members *[Time].[Hierarchy].members,[Measures].[Overall LU SR]))
    MEMBER [KPI Name] AS "Overall LU"
    MEMBER [KPI Value] As KPIValue("Overall LU SR")
    MEMBER [KPI Status] AS KPIStatus("Overall LU SR")
    MEMBER ObjectName as "Overall LU SR"
    MEMBER [Critical Threshold] as  [KPI Thresholds].[Threshold1].&[Overall LU SR].member_value
    MEMBER [Major Threshold] AS  [KPI Thresholds].[Threshold2].&[Overall LU SR].member_value
    MEMBER [Minor Threshold] AS 0
    MEMBER latestDate as [Date].[Hierarchy].membervalue, format_string = 'mm/dd/YYYY'
    MEMBER latestTime as [Time].[Hierarchy].member_caption
    SELECT  {latestDate,latestTime,ObjectName,[Measures].[KPI Name], [KPI Value],[KPI Status],[Measures].[Critical Threshold],[Measures].[Major Threshold],[Measures].[Minor Threshold]} ON COLUMNS
    ,nonempty(LastSample) ON ROWS
    FROM [DRA]
    Surendra Thota

  • One jsp one form tag having 3 different values

    <tr>
    <td width="120%" align="right" bgcolor="#FFFFFF" colspan="4" >
    <input type="submit" value="Submit" name="Submit">
    <input type="submit" value="Delete" name="Delete">
    <input type="submit" value="Approve" name="Approve">
    </td>
    </tr>
    In Jsp have one form having 3 button with 3 different values.
    My problem is on 3 button have 3 different action called.
    i face this problem very curisal.
    So plz give me reply its very urgent
    Thanks in Advance

    Do it with javascript.
    Rather than: <input type="submit" value="Submit" name="Submit"> use a <input type="button" name="submit" value="Submit" onclick="checkClick();" />
    Then your javascript function - "checkClick" and set an indicator as to which button was clicked and then invoke the submit function.

  • Why autocreate function confuse different PRs in one PO?

    I created PO using autocreate function from different PRs. It was not possible to select "requisition" grouping, only "default". The result is a totally confused PO with mixed distributions, prices, etc. The total amount is also different from the PRs summarized amounts.
    Should I forget autocreate in this case or is there any solution for this problem?
    Thanks in advance.

    Dear Szabolcs,
    I am explaining you after doing on my test instance 11i (11.5.10.2).
    (1) If we are going for Autocreate with Grouping = Default , it will consolidate the PR line.
    (2) If we are going for Autocreate with Grouping = Requisition , it will create a separate PO line even though there is a same item and
    same Need-By date on PR level. Also price will remain intact as per PR line.
    In both the case, please set the following profiles to NULL value.
    (1) PO: Default Requisition Grouping
    (2) PO: Use Need-by Date for Default Autocreate Grouping
    HTH...
    Sanjay

  • Ok, im new to numbers but i cant work this one out. In column A is an average of hours worked. I have 4 columns. A and B have different values. Column C is an average of hours worked. When column C is less then 8 i need column D to equal column a

    Ok, im new to numbers but i cant work this one out. I have 4 columns. A and B have different values. Column C is an average of hours worked. When column C is less then 8 i need column D to equal column A. When column C is equal or greater then 8 i need column D to equal the sum of A and B.

    Hi Lucas,
    Try this:
    Formula in D2 (and Fill Down) =IF(C2<8, A2,A2+B2)
    The IF function follows the logic of if, then, else.
    IF(this is true, then do this, else do that)
    If it is raining, then stay at home, else hold a picnic .
    Regards,
    Ian.

  • Combobox in Datagrid with different values

    Hi All,
    I have a datagrid. One of the columns in the datagrid is set
    to display a combobox as the ItemRenderer. Now, the data for the
    combobox is different for each row. How do I set up the data
    provider for the combobox in such a scenario.
    For example : I have a collection of Shirt objects.
    public class Shirt {
    public String id;
    public String type;
    public String[] color; //this is an array
    This should be displayed in the datagrid, with the Color
    column rendered as a combobox. The colors will be different for
    each shirt.
    Thanks
    CS

    Yes. Some more detail:
    in the function,
    override public function set data(value:Object): void {
    the "value" parameter will contain a refernce to an entire
    "Shirt" instance.
    So you can assign the comboBox.dataProvider=value.color;
    Now, It is more complicated than this, because you will want
    the combobox to show the correct value for each row, right?
    For this to happen, you will need a selectedColor property on
    Shirt. When the user chooses a color, you will need to update this
    property with the selection.
    Next, your renderer must read the value of selectedColor and
    set the comboBox.selectedIndex.
    If selectedColor contains the *index* of the color then you
    have it easy. If it contains the color name itself, then you will
    have to for-loop over the color array until yom match the
    selectedColor. then you will have the index and can set
    selectedIndex.
    ComboBox does not support setting the value directly. It is
    pretty easy to extend combo to do this. There are several examples
    out there. I posted a link to one on CFLEX.net
    Tracy

  • Different values for key figure in fm.

    Hi All,
    The following function modules giving different results in q and production.
    Pls tell me why different values?
    FOLLOWING ARE THE INPUTS I GAVE,
    I_DATE_FROM = 31.01.2011
    I_TIME_FROM  = 08:32:00
    I_DATE_TO =  31.01.2011
    I_TIME_TO = 12:24:13
    In Production iam getting 0
    But in Q iam getting A VALUE.
    PLS HELP ME HERE..
    *"  IMPORTING
    *"     VALUE(I_DATE_FROM) TYPE  D
    *"     VALUE(I_TIME_FROM) TYPE  T DEFAULT 0
    *"     VALUE(I_DATE_TO) TYPE  D
    *"     VALUE(I_TIME_TO) TYPE  T DEFAULT 0
    *"     VALUE(I_WERK) LIKE  /BI0/SPLANT-PLANT OPTIONAL
    *"     VALUE(I_FABKL) LIKE  /BI0/SFACTCAL_ID-FACTCAL_ID OPTIONAL
    *"  EXPORTING
    *"     REFERENCE(E_DURATION_INT) TYPE  F
    *"     REFERENCE(E_DURATION_EXT) TYPE  F
    *"     REFERENCE(E_UNIT_DAY) LIKE  /BI0/SUNIT-UNIT
      DATA:
        l_start       LIKE scal-facdate,
        l_end         LIKE scal-facdate,
      L_DURATION_S  LIKE MCQAVE-DLZEIT,
        l_duration_s  TYPE f,
        l_flg_error(000001)   TYPE c,
        l_delta_s     TYPE i,
        l_t001w       LIKE /bi0/pplant,
        l_dimension   LIKE t006-dimid,
        l_factcal_id  LIKE /bi0/pplant-factcal_id,
        l_delta_d     TYPE f,
        l_wd_end      TYPE scal-indicator,
        l_wd_from     TYPE scal-indicator.
      STATICS
        s_unit_day    LIKE /bi0/sunit-unit.
    *== Compute duration
      e_duration_ext
        =  i_date_to - i_date_from + ( i_time_to - i_time_from ) / 86400.
      IF NOT ( i_werk IS INITIAL )  OR
         NOT ( i_fabkl IS INITIAL ).
    *== Compute duration according to fabrics calender
      Read Calender ID
       CALL FUNCTION 'ZEW05_PLANT_READ'
            EXPORTING
                 WERKS  = I_WERK
            IMPORTING
                 STRUCT = L_T001W
            EXCEPTIONS
                 OTHERS = 01.
        IF i_fabkl IS INITIAL.
    *== Selektion der Fabrikkalender-ID abhängig vom Werk.
          SELECT factcal_id FROM  /bi0/pplant INTO l_factcal_id WHERE
                         plant = i_werk AND
                         objvers = 'A'.
          ENDSELECT.
        ELSE.
          l_factcal_id = i_fabkl.
        ENDIF.
        IF NOT ( l_factcal_id IS INITIAL ).
          CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
            EXPORTING
              date                 = i_date_from
              factory_calendar_id  = l_factcal_id
            IMPORTING
              factorydate          = l_start
              workingday_indicator = l_wd_from
            EXCEPTIONS
              OTHERS               = 01.
        ENDIF.
        IF sy-subrc = 0.
          CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
            EXPORTING
              date                 = i_date_to
              factory_calendar_id  = l_factcal_id
            IMPORTING
              factorydate          = l_end
              workingday_indicator = l_wd_end
            EXCEPTIONS
              OTHERS               = 01.
        ENDIF.
        IF sy-subrc = 0.
    *--   Compute duration
          IF NOT l_wd_end IS INITIAL.
            i_time_to = '000000'.
          ENDIF.
          IF NOT l_wd_from IS INITIAL.
            i_time_from = '000000'.
          ENDIF.
          e_duration_int
            =  l_end - l_start + ( i_time_to - i_time_from ) / 86400.
        ELSE.
          e_duration_int = '0.0'.
        ENDIF.
        IF e_duration_int < '0.0'.                            "#EC PORTABLE
          e_duration_int = '0.0'.
        ENDIF.
      ENDIF.
      IF s_unit_day IS INITIAL.
        CALL FUNCTION 'DIMENSION_GET'
          EXPORTING
            time                = 1
          IMPORTING
            dimid               = l_dimension
          EXCEPTIONS
            dimension_not_found = 01.
        IF sy-subrc = 0.
          CALL FUNCTION 'UNIT_GET'
            EXPORTING
              denominator    = 1
              dimension      = l_dimension
              numerator      = 86400
            IMPORTING
              unit           = s_unit_day
            EXCEPTIONS
              unit_not_found = 01.
        ENDIF.
      ENDIF.
      e_unit_day = s_unit_day.
    ENDFUNCTION.

    check the table /bi0/pplant in your production system. and see if the attribute factcal_id contains value.
    Make sure that you have Plant master data loaded in your production system.
    --- Thanks...

  • :VARIABLE_NAME and v('VARIABLE_NAME') have different values

    A basic question ...
    I have the following ... (including some debug stuff) ...
    IF (:P3_PE_REQ_STATE = 'NEW') THEN
    :P3_PE_REQ_STATE := 'DRAFT';
    insert into debug_table values(null,v('P3_PE_REQ_STATE'));
    insert into debug_table values(null,:P3_PE_REQ_STATE);
    commit;
    END IF;
    The DEBUG_TABLE shows two different values ... with v('P3_PE_REQ_STATE') = 'NEW' and :P3_PE_REQ_STATE = 'DRAFT'
    Why would these be different?

    In ajc's block, v('P3_PE_REQ_STATE') obtains the value from the PL/SQL package state copy of session state in the database session. This is the pre-updated value. The assignment statement with :P3_PE_REQ_STATE on the left-hand side changes the value of the bind variable, which may be subsequently altered/referenced as a bind variable to the extent the name remains in scope for the duration of the dynamic execution of the block. At the end of the block, the final value of any bind variables corresponding to page or application items and whose pre- and post-execution values are different are written to the session state tables and committed (using the same code invoked by HTMLDB_UTIL.SET_SESSION_STATE). At that point the package-state copy of session state is also updated so that subsequent references using the v function will get the updated value.
    Scott

  • Accessing function's return value

    Hi there. I have created several pl/sql procedures and functions that I can run as standalone programs and I have no problem integrating them into my java code also. However I cannot access the return value of any created function from my java code. The functions appear to execute correctly because when I deliberately enter an invalid select statement I get the errors I expect to get for that instance nad if I enter a valid select statement in the function the program executes correctly but I still cannot access the function's return value. My java code where I execute the pl/sql function is as follows:
    CallableStatement p = cont.conn.prepareCall("{call ? := Hellen.FUNC}");
    p.setString(1, "z006"); //hellen.FUNC = function name
    p.execute();
    How do I access the return value of my function?
    Do I need to get a ResultSet?
    My function is as follows:
    function func
    return varchar
    is tester varchar(4);
    BEGIN
    select cfcc_code into tester from hellen.test1 where test1.cfcc_code = 'A21';
    return tester;
    END;
    Any help will be gratefully received, Joe

    You need to do something like
    p.registerOutParameter(1, java.lang.String);
    p.execute();
    String result = p.getString(1);Cheers, APC

Maybe you are looking for

  • IPod touch 2nd gen won't connect to WiFi

    I just bought iPod touch 16GB 2nd gen and I'm having trouble with using some WiFi networks. I can use unsecured networks, but I am unable to use ANY protected networks. Whenever I try, it asks me for the password, I enter it and then it gives me 'una

  • Acrobat pro 9

    Cannot update adobe acrobat pro 9 "cant find updates"  . Is it possible to manually update and where can we find the updates, we only found adobe acrobat xl ?

  • Disappearing folder

    Major Xsan troubles here, started last Friday. The Xsan has a dozen or so folders at the top level. When viewed from the Finder, one of those folders has no icon and reports a date sometime in 1904. When I try to select this folder (click on it), it

  • Static main methods and run()

    I am having trouble with main methods, and how to structure code, im not 100% sure on what static methods are, and im not sure how to use it when calling other methods etc cos its static and stuff - i read that i should put stuff in the constructor -

  • Can MOPZ be used without installing Diagnostic Agent.

    Hi, I need a clarification. In Solution Manger 7.1 Version, can I use Maintenace Optimizer (MOPZ) to download SP's for a Managed System without prior installing Diagnostic Agent on the Managed System? If Yes, please write a brief procedure as below.