Year , Month & Day from Date.

Hi HANA experts,
  Do help me to resolve this issue
How can we extract or fetch year from the date.i went through some of the SCN blogs.where they create calculation views...but the steps are not that clear to me.
can anyone please explain??
My scenario is :
I have date field in ANALYTIC VIEW which i have fetched from ECC  tables.
now i need to get  the year  wise month wise and day wise reports. so what steps i should do in calculation view to get that??
thanks
Neeraja

there is no ECC under SAP...as we are using suite on HANA fro AWS.and there is no restriction done by the basis till now...
as we are new to these unable to trouble shoot things easily.
thanks for your reply..

Similar Messages

  • Find year,month & day between dates

    Hi,
       I need to find a number of years, months & day between a given dates. For example If a employee joined on 31.01.2003 and left on 01.06.2006, I need to find in between how many years, months & days he has worked. Is there any function module available .

    DATA: EDAYS LIKE VTBBEWE-ATAGE,
    EMONTHS LIKE VTBBEWE-ATAGE,
    EYEARS LIKE VTBBEWE-ATAGE.
    PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
    TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
    Call Function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
      exporting
        i_date_from          = FROMDATE
        i_date_to            = TODATE
    *   I_FLG_SEPARATE       = ' '
      IMPORTING
        E_DAYS               = EDAYS
        E_MONTHS             = EMONTHS
        E_YEARS              = EYEARS.
    WRITE:/ 'Difference in Days   ', EDAYS.
    WRITE:/ 'Difference in Months ', EMONTHS.
    WRITE:/ 'Difference in Years  ', EYEARS.
    INITIALIZATION.
    FROMDATE = SY-DATUM - 60.
    Using teh abiove u can get difference but when u pass previous year u wont get the exact.
    There is no seperate FM for this, u have to use three FM.
    If possible using these three FM code u can create an FM.
    <b>For years and months between two days:</b>
    DATA:   EYEARS  LIKE VTBBEWE-ATAGE.
    PARAMETERS: FROMDATE LIKE PREL-BEGDA,
                     TODATE   LIKE PREL-BEGDA DEFAULT SY-DATUM.
    CALL FUNCTION 'COMPUTE_YEARS_BETWEEN_DATES'
      EXPORTING
        first_date                        = fromdate
    *   MODIFY_INTERVAL                   = ' '
        second_date                       = todate
    IMPORTING
       YEARS_BETWEEN_DATES               =  EYEARS
    * EXCEPTIONS
    *   SEQUENCE_OF_DATES_NOT_VALID       = 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.
    Write:/ eyears.
    DATA:       EMONTHS LIKE VTBBEWE-ATAGE.
    PARAMETERS: FROMDATE LIKE SY-DATUM,
                TODATE   LIKE SY-DATUM
    DEFAULT SY-DATUM.
    CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
      EXPORTING
        i_datum_bis         = fromdate
        i_datum_von         = todate
    *   I_KZ_INCL_BIS       = ' '
    IMPORTING
       E_MONATE            = emonths
    write:/ emonths
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
    EXPORTING
    I_DATUM_BIS = x_faede-zfbdt
    I_DATUM_VON = p_fdat
    I_KZ_EXCL_VON = '0'
    I_KZ_INCL_BIS = '0'
    I_KZ_ULT_BIS = ' '
    I_KZ_ULT_VON = ' '
    I_STGMETH = '0'
    I_SZBMETH = '1'
    IMPORTING
    E_TAGE = dias_v.
    IF SY-SUBRC <> 0.
    ENDIF.
    x_faede-zfbdt -> 20050915
    p_fdat -> 20050811
    dias_v = 4
    try this and let me know.
    Message was edited by:
            Judith Jessie Selvi

  • Extract Year/Month/ Week From Date

    BW Experts,
      I have a Time Char in a New OSD i am developing. Say the Time char is 0Req_date. This 0req_date is updated using some calculation in my update rules (Say 0Req_Date = Act_dl_dt - Conf_date). Now I have to extract month/ year/ week and populate Time Chars 0REQ_MONTH, 0REQ_YEAR and 0REQ_WEEK respectively from 0REQ_DATE. Can I do this via respective rules to 0REQ_MONTH, 0REQ_YEAR and 0REQ_WEEK in the update rules. My concern is as OREQ_DATE itself is a calculated field, can month/year/week be extracted correctly? Hope I have put the question across understandably. Help is appreciated.
    Thanks
    Ashwin

    Hi Ashwin,
    It can be done...you can either put the code for all these derivations in the Start Routine of the update rule, making sure that the 0REQ_Date is calculated before the others. Or you can also calculate just the 0REQ_DATE in the start routine and use the individual update routines to populate the other time chars.
    Processing using the Start Routine is recommended for efficiency and better performance.
    Hope this helps...

  • How to add a date(Year, Month, Day) table in OBIEE Administrator

    Hi,
    I am new to this tool, we are developing a HR report for emp on leave or absentees. we have data since 1982 in our tables. we want to have a date table and dimension where we can give have a hierarchy for year, month, day, so that we can design our dashboards based on time. how we can do that in OBIEE Administrator and can we do it in warehouse builder as well, if so, how. ( we have a column for date in the table by name 'leave start date' and 'leave end date', can we use this and create our own table with year month and day as separate columns).
    Thanks.

    hi,
    Using date column u can create time dim in BMM layer
    Create a new logical table and pull your date column to this table
    Next,create following columns
    Refer http://www.rittmanmead.com/2007/04/30/obi-ee-time-dimensions-and-time-series-calculations
    leave start date
    Year level :Extract(year from date_column)
    Month and year level:CAST (Extract(month from fact_date_column) As CHAR(5) ) || CAST (Extract(yearfrom fact_date_column) As CHAR(5) )
    Mon-YYYY: EVALUATE('TO_CHAR(%1,%2)' AS CHARACTER ( 30 ), "Development".""."sample sales"."Dim - leave Date"."REPORT_DATE", 'MON-YY')
    YYYY-MM : CAST ( EXTRACT( YEAR FROM "sample sales".""."sample"."Dim - Report Date"."LEAVE_DATE") AS CHARACTER ( 4 )) || '/' || CASE WHEN EXTRACT( MONTH FROM "sample sales".""."sample"."Dim - Report Date"."LEAVE_DATE") BETWEEN 10 AND 12 THEN CAST ( EXTRACT( MONTH FROM "sample sales".""."sample"."Dim - Report Date"."LEAVE_DATE") AS CHARACTER ( 2 )) ELSE '0' || CAST ( EXTRACT( MONTH FROM "sample sales".""."sample"."Dim - Report Date"."LEAVE_DATE") AS CHARACTER ( 1 )) END
    Year Quater :: EVALUATE('TO_CHAR(%1,%2)' AS CHARACTER ( 6 ), "sample sales".""."sample"."Dim -Leave Date"."REPORT_DATE", 'YYYY') || '0' || EVALUATE('TO_CHAR(%1,%2)' AS CHARACTER ( 6 ), "sample sales".""."sample"."Dim -Leave Date"."REPORT_DATE", 'Q')
    Day: EXTRACT(DAY FROM DATE_COLUMN)
    Thanks,
    Saichand.v

  • Date difference in years,month,days should consider Leap Year

    I would like to know how to compute the difference between two Date, and get the difference in years,months,days, PS. Should include New Year
    Eg Date1 : 01/01/2000
    Date2: 01/01/2005
    Diff: years=5, months=0 days=1 for a leap year is included'2004'

    I would like to know how to compute the difference
    between two Date, and get the difference in
    years,months,days, PS. Should include New Year
    Eg Date1 : 01/01/2000
    Date2: 01/01/2005
    Diff: years=5, months=0 days=1 for a leap year is
    included'2004'If any program I was using gave me that result, I would consider it a bug.

  • Finding Day from Date i.e. Monday, Tuesday etc

    Hi,
    I need to find out the day from Date. i.e. Monday, Tuesday etc. This is because if the date falls on Saturday or Sunday need to charge difference rates and on weekdays having normal rates.
    Thanks,
    Amol

    We should probably add a function for this as I've certainly seen the requirement before.
    Fortunately it's pretty easy to calculate using a simple rule - the trick is to pick a date in the past that was a Monday, and then use the modulo operator.
    For example:
    The day of the week = (the given date - 1980-01-07) modulo 7
    ie the 7th of January 1980 was a Monday, so every 7th day after that is also a Monday - so combined with the modulo operator this will give you:
    0 monday
    1 tuesday
    5 saturday
    6 sunday
    The only downside is that dates before 1980-01-07 will give a negative modulo (this is distinct from the mathematical modulo operator, but is necessary to be symmetric with the integer division operator truncating towards zero) - so dates before the baseline date will give:
    0 monday
    -6 tuesday
    -2 saturday
    -1 sunday
    You can either choose to write the rules to take this into account, or choose a baseline date so far in the past that it's unnecessary.
    Regards
    Andrew

  • Release Date for Albums Year, MONTH DAY

    Why can't I enter the release date for albums (Year month and day)?   Itunes has a field for year but that's it.    I would have loved to be at the meeting where it was discussed.
    "Year, month and day? why the heck would any want that?"
    "Well a lot of us want to see our albums in chronological order and you can't do that with just the year, many albums come out every year"
    "Blah Blah Blah, music is just to dance to, no one cares about dates, besides it would four extra digit fields in each entry"
    But seriously, I would think that Itunes would aspire to be THE program for music lovers.
    Instead of being able to just enter the release dates I have had to come up with my own work around.  I put a the release date in the format yyyymmdd in fromt of each title and then sort by titles.
    Now all of my Beatle albums finally show up in chronological order by release date.   But why should I have to massage the data like this.   I can't imagine what goes on at Itunes planning  sessions.  I'm very unhappy about the loss of cover flow but that's another story.

    I'm glad to hear that I am not the only one who sees this as a problem.  And another Beatles fan too.
    This is so fundamental.  Every album has a release date and it's part of the data that is always associated with  that album.   Why did Apple look at the data available for an album and consciously decide to truncate it?
    What kind of music lover isn't aware of when albums are released?  I just don't get it.
    I like having the date yyyymmdd in front of each album.   It isn't pretty but it means the albums are chronological.   If you want, you could just put this in the sort field and leave the regular album title in the regular field.   Then the names would be right and they would sort correctly.   But again.  Why should we have to do all that? 
    Apple is busy constantly changing where the controls are on I tunes  rather than fixing something simple and important like this.
    Today I wanted to load some songs onto my ipod touch and it took me 10 minutes to figure out how to sync because the last itunes update got rid of the side bar.  
    How are you supposed to get comfortable using a product when they keep moving the controls around?   Just quit apple.   leave the controls where they are.  Add new controls if needed but stop moving them.  I know I'm ranting now but I am honestly angry and frustrated,

  • Calculating years,months & days

    Hi,
    i have to calculate the time duration in years,months and days between contract_start_date and contract_end_date
    eg: Contract_Start_Date = '17-nov-2006' and Contract_End_Date = '21-jan-2008'

    Rehman wrote:
    Hi,
    i have to calculate the time duration in years,months and days between contract_start_date and contract_end_date
    eg: Contract_Start_Date = '17-nov-2006' and Contract_End_Date = '21-jan-2008'It's not the simplest of things to work out.
    If you use the intervals it will, like any other calculation, struggle with the fact that there are different number of days in the month and leap years to take account of.
    Whilst it's simple enough to determine how many whole years have passed and how many months difference there is, the moment you start to take account of the days you become stuck because days in conjunction with months cause the day calculation to be a little more indeterminate...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select to_date('17-nov-2006','dd-mon-yyyy') as c_start_date, to_date('21-jan-2008','dd-mon-yyyy') as c_end_date from dual union all
      2             select to_date('21-nov-2006','dd-mon-yyyy'), to_date('17-feb-2008','dd-mon-yyyy') from dual union all
      3             select to_date('21-jun-2006','dd-mon-yyyy'), to_date('17-jul-2008','dd-mon-yyyy') from dual
      4             )
      5  -- end of test data
      6  select c_start_date, c_end_date,
      7         to_char(c_end_date,'YYYY')-to_char(c_start_date,'YYYY')
      8        -(case when to_date(to_char(c_end_date,'DD-MM')||'-1900','DD-MM-YYYY') <
      9                    to_date(to_char(c_start_date,'DD-MM')||'-1900','DD-MM-YYYY') then 1 else 0 end) as years_between
    10        ,case when to_date(to_char(c_end_date,'DD-MM')||'-1900','DD-MM-YYYY') <
    11                    to_date(to_char(c_start_date,'DD-MM')||'-1900','DD-MM-YYYY') then
    12                    12+(to_char(c_end_date,'MM')-to_char(c_start_date,'MM'))
    13         else (to_char(c_end_date,'MM')-to_char(c_start_date,'MM'))
    14         end -
    15        (case when to_date(to_char(c_end_date,'DD')||'-01-1900','DD-MM-YYYY') <
    16                   to_date(to_char(c_start_date,'DD')||'-01-1900','DD-MM-YYYY') then 1 else 0 end)
    17         as months_between
    18        ,case when to_date(to_char(c_end_date,'DD')||'-01-1900','DD-MM-YYYY') >
    19                   to_date(to_char(c_start_date,'DD')||'-01-1900','DD-MM-YYYY') then
    20              (to_char(c_end_date,'DD')-to_char(c_start_date,'DD'))
    21         else 31-(to_char(c_start_date,'DD')-to_char(c_end_date,'DD'))
    22         end as days_between_approx
    23        ,(c_end_date-c_start_date) year(4) to month as interval_yyyy_mm
    24* from t
    SQL> /
    C_START_D C_END_DAT YEARS_BETWEEN MONTHS_BETWEEN DAYS_BETWEEN_APPROX INTERVAL_YYYY_MM
    17-NOV-06 21-JAN-08             1              2                   4 +0001-02
    21-NOV-06 17-FEB-08             1              2                  27 +0001-03
    21-JUN-06 17-JUL-08             2              0                  27 +0002-01
    SQL>This example shows that a manual calculation can determine the number of years and months ok, but the days have to be approximated; and the interval answer isn't giving the same result for the months as the manual calculation because it can't take account of the days at the same time.

  • Week and month calculation from date column

    I have 3 column data like
    with tab as
      select 'Topshop' brand, '10-JUL-11' deliverydate, '100' qty from dual union all
      select 'Topshop' brand, '10-JUL-11' deliverydate, '400' qty from dual union all
      select 'NewSita' brand, '11-JUL-11' deliverydate, '200' qty from dual union all
      select 'LaGress' brand, '12-JUL-11' deliverydate, '300' qty from dual union all
      select 'LaGress' brand, '10-AUG-11' deliverydate, '100' qty from dual union all
      select 'LaGress' brand, '11-AUG-11' deliverydate, '200' qty from dual union all
      select 'Topshop' brand, '12-AUG-11' deliverydate, '300' qty from dual union all
      select 'NewSita' brand, '10-SEP-11' deliverydate, '100' qty from dual union all
      select 'Topshop' brand, '11-SEP-11' deliverydate, '200' qty from dual union all
      select 'NewSita' brand, '12-SEP-11' deliverydate, '300' qty from dual
    ) select * from tabI need to convert it into 4 columns
    Brand | Month | Week(start date) | Qty (sum)
    Please let me know what are the options that i have, especially the date-time calculation functions available to solve such problems.
    Thanks
    w\

    with tab as
      select 'Topshop' brand, to_date('10-JUL-11', 'dd-mon-yy') deliverydate, '100' qty from dual union all
      select 'Topshop' brand, to_date('10-JUL-11', 'dd-mon-yy') deliverydate, '400' qty from dual union all
      select 'NewSita' brand, to_date('11-JUL-11', 'dd-mon-yy') deliverydate, '200' qty from dual union all
      select 'LaGress' brand, to_date('12-JUL-11', 'dd-mon-yy') deliverydate, '300' qty from dual union all
      select 'LaGress' brand, to_date('10-AUG-11', 'dd-mon-yy') deliverydate, '100' qty from dual union all
      select 'LaGress' brand, to_date('11-AUG-11', 'dd-mon-yy') deliverydate, '200' qty from dual union all
      select 'Topshop' brand, to_date('12-AUG-11', 'dd-mon-yy') deliverydate, '300' qty from dual union all
      select 'NewSita' brand, to_date('10-SEP-11', 'dd-mon-yy') deliverydate, '100' qty from dual union all
      select 'Topshop' brand, to_date('11-SEP-11', 'dd-mon-yy') deliverydate, '200' qty from dual union all
      select 'NewSita' brand, to_date('12-SEP-11', 'dd-mon-yy') deliverydate, '300' qty from dual
    ), week_data as (
       select brand
       ,      to_char(deliverydate, 'Month', 'nls_date_language=american') MON
       ,      trunc(deliverydate, 'day') WEEK_START
       ,      sum(TO_NUMBER(qty)) SUM_QTY
       from   tab
       group by brand
       ,      to_char(deliverydate, 'Month', 'nls_date_language=american')
       ,      trunc(deliverydate, 'day')
    ), weeks as (
       select
       w.week_min + (level - 1) * 7 week_start
       from (
          select min(week_start) week_min, max(week_start) week_max
          from week_data
       ) w, dual
       connect by level <= 1 + (w.week_max - w.week_min) / 7
    select
    week_data.brand,
    weeks.week_start,
    nvl(week_data.sum_qty,0) sum_qty
    from week_data
    partition by (brand)
    right outer join weeks
    on (weeks.week_start = week_data.week_start)
    order by
    weeks.week_start,
    week_data.brand;You construct a set of records of all "week_start" dates from your minimum to your maximum (classic connect by level trick.)
    You use a partitioned outer join to fill in the gaps in your sparse data (see doc example [url http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_10002.htm#i2177515]here.
    Hope that helps you :-)
    (PS. I dislike implicit conversions - that is the only reason I have added a TO_NUMBER to your code within the sum() ;-) )
    (PPS. Actually you probably should have asked this in a new question - I believe it is not really good forum etiquette to continue in a thread that has already been answered...)

  • FM for getting MONTH name from DATE.

    Hi all ,
    We have a requirement to get Month name from the DATE,e.g IF date is 01/01/2008 we need a FM which can generate month name as 'JANUARY'.
    \[removed by moderator\]
    Thanks and Regards
    Kiran
    Edited by: Jan Stallkamp on Jul 30, 2008 4:26 PM

    Hi,
    Here is the code u required...
    REPORT  ZASHU_MONTH_NAMES_GET.
    data:r_code type sy-subrc.
    data:mnames type standard table of T247 with header line.
    CALL FUNCTION 'MONTH_NAMES_GET'
    EXPORTING
       LANGUAGE                    = SY-LANGU
    IMPORTING
         RETURN_CODE                 = r_code
    TABLES
        month_names                 = mnames.
    EXCEPTIONS
      MONTH_NAMES_NOT_FOUND       = 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.
    write:/ mnames.
    Thanks & Regards
    Ashu Singh

  • Extract month part from date

    hi,
    I have a query in Informix which get the month part of a date. Please help me in converting the same to oracle.
    Informix query
    select month(col1 - today) from tab1;
    col1 is a date field, today will yield the current date and month function will get the month of the date.
    In oracle, when we subtract two dates we will get a number value, how to convert that back to date and extract the month part.
    Help me?????
    Regards,
    Gopu

    If your looking for the number of months between two dates:
    SQL> select months_between(sysdate, trunc(sysdate,'yyyy')) from dual ;
    MONTHS_BETWEEN(SYSDATE,TRUNC(SYSDATE,'YYYY'))
    6.06223081
    Just replace my usage of sysdate (etc) with the dates your using...
    Hope that helped,
    Stan

  • Subtract business days from date - calculated column

    Hello,
    I had a calculated column on a library that took two dates and found the difference between them in business days, but I am not sure how to subtract business days from a date...for instance I get a start date from a form and I need to
    subtract 10 business days from that date.
    Can anyone help?

    I've always resorted to Javascript/JQuery for that kind of function. I found an old fashioned loop worked the best for me - it supports going forward or backwards. I key it off of a change in a starting date, or sometimes a status change. My actual production
    code takes into account another list where we remove holidays and non-work days.
    newDate = getNextDate(newDate, -3);
    $("input[title='Date Due']").val((newDate.getMonth() + 1) + "/" + newDate.getDate() + "/" + newDate.getFullYear());
    function getNextDate(currentDate, offset) {
    // offset is business days
    var wkend = 0;
    var index = Math.abs(offset); // need positive number for looping
    var neg = true;
    if(offset >= 0) { neg = false; }
    var curDOW = currentDate.getDay();
    var nextDate = new Date(currentDate);
    for(var i=1; i <= index; i++) {
    nextDate.setDate(nextDate.getDate() + (neg ? -1: 1));
    var nextDOW = nextDate.getDay();
    if(nextDOW == 0) {nextDate.setDate(nextDate.getDate() + (neg ? -2: 1));} // Sunday
    if(nextDOW == 6) {nextDate.setDate(nextDate.getDate() + (neg ? -1: 2)); } // Sat
    // alert("offset is " + offset + "start: " + currentDate + ", next date is " + nextDate);
    return nextDate;
    Robin

  • Extrating day from date

    Hi All,
    Extracting day form sysdate is <?xdoxslt:sysdate(‘Day’)?>
    but i want to extract day from <?xdoxslt:ora_format_date_offset(xdoxslt:sysdate('YYYY-MM-DD'),1,'-')?> (sysdate-1 date's day)
    How can i ? any ideas pleae share me.
    Thanks

    DD is working fine
    <?xdoxslt:xdo_format_date($_XDOXSLTCTX,(xdoxslt:ora_format_date_offset(xdoxslt:sysdate('YYYY-MM-DD'),1,'-')),’DD’)?>
    Day and Dy is not working giving result like check boxes
    <?xdoxslt:xdo_format_date($_XDOXSLTCTX,(xdoxslt:ora_format_date_offset(xdoxslt:sysdate('YYYY-MM-DD'),1,'-')),’Day’)?>
    do i need to give any supporting format for xdo_format_date?

  • How to relate current day to date hierarchy [year - month - day] for SSRS report paramenter

    Hi there: 
      I've created a SSRS report based on OLAP cube. In this report, there is a date parameter which is used to filter out data. 
    Now , I want this report to be run and always retrieve data from previous day. I need to supply the date parameter with something
    like SQL syntax: DATEADD(dd,-1,GETDATE())  . The question is how can I do that in the MDX world? 
     thanks
     Hui
    --Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

    Hi Hui,
    According to your description, you need to retrieve data from previous day, so you are looking for an expression in MDX which can achieve the requirement like SQL syntax: DATEADD(dd,-1,GETDATE()), right?
    As per my understanding, it easy to achieve this requirement in report level ranther than in MDX query level. You can create another hidden parameter "Date2" using the expression below.
    =DateAdd("d",-1,Parameters!Date.Value)
    Then use Date2 parameter to filter in the query.
    If don't want to create another parameter, you can use it like below.
    Year     =DatePart("yyyy",DateAdd("d",-1,Parameters!Date.Value))
    Quarter  =DatePart("qq",DateAdd("d",-1,Parameters!Date.Value))
    Month    =DatePart("mm",DateAdd("d",-1,Parameters!Date.Value))
    Week     =DatePart("ww",DateAdd("d",-1,Parameters!Date.Value))
    Besides, DateAdd function is supported in MDX, please refer to the link below.
    http://msdn.microsoft.com/en-us/library/hh510163.aspx
    If I have anything miunderstand, please point it out.
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Extraing Month part from date value in varchar column

    Guys,
    I have varchar2 column contains date value in the format '2013/10/03' and i want extract month part of it.
    Iam doing like this  TO_CHAR(TO_DATE(L_BATCH_DATE,'MM'))='10'   
    and it says 'not a valid month'.any ideas? and how to get that value?
    Cheers

    Hi,
      Is this are you trying.
    to_date --> we will use this function to inform oracle the date is in character mode with this format
         to_date('2013/10/03','yyyy/dd/mm')
    select to_char(to_date('2013/10/03','yyyy/dd/mm'),'mm') from dual;

Maybe you are looking for

  • How to specify the webLogic server startup script to use different config.xml  file ??

    Hi, I have 2 weblogic startup scripts (startWebLogic.sh and startWebLogic_recovery.sh) for the same domain. startWebLogic.sh uses config.xml file. I would like to use config_recovery.xml as the configuration file for startWebLogic_recovery.sh How wou

  • Outer join with conditon

    I have two tables T1 name id a 1 b 2 c 3 T2 id type 1 17 1 19 2 18 Now i want to join the two tables using left outer join and the condition on the table T2 is type=19. If for a particular id if type is present then the target table should get that t

  • Not able to send texts to other iPhones why?

    MNot able to send texts to other iPhones why?

  • HTML code for region position 3

    Hi All, Can i get the HTML code for display point: Region position 3. My requirement is, i have to apply some background color to all the regions which are placed in region position 3.

  • Slow LTE speeds after update to ios 8.1

    I have a iphone 5s on T-Mobile with unlimites LTE and I updated from 8.0.2 to 8.1 and now i have HORRIBLE! Lte speeds. And its every where i go i tried reseting the network settings i even reset the phone like new and nothing. I tried to downgrade ba