How to get values between two years??

select distinct a.band_no_daftar, a.episod, a.band_nama1, a.penjara,
to_char(b.trkh_semak_layak,'yyyy') as tahun,
c.penj_lokasi
from banduan a, prl_semak_layak b, penjara c
where a.band_no_daftar =  b.no_daftar(+)
and  a.episod = b.episod(+)
and a.penjara = c.penjara_id
and b.status_layak = 1
and b.trkh_semak_layak between trunc(to_date(:dari,'yyyy')) and to_date(:hingga,'yyyy')
group by  c.penj_lokasi, a.band_no_daftar, a.episod, a.band_nama1, a.penjara,
           to_char(b.trkh_semak_layak,'yyyy')
order by a.penjarahow i'm going to retrieve records between two years??for example from year 2011 to 2012.

CREATE TABLE PRL_SEMAK_LAYAK
  NO_DAFTAR          VARCHAR2(10 BYTE)          NOT NULL,
  EPISOD             NUMBER(2)                  NOT NULL,
  TL_HUK             NUMBER(1),
  TL_KLAS            NUMBER(1),
  TL_JAD4            NUMBER(1),
  TL_KESLAIN         NUMBER(1),
  TL_LP              NUMBER(1),
  TL_RAY             NUMBER(1),
  TL_PPI             NUMBER(1),
  STATUS_LAYAK       NUMBER(1),
  TRKH_LAYAK_PAROL   DATE,
  KOD_PEJABAT_PAROL  VARCHAR2(10 BYTE),
  TRKH_MULA_PRL      DATE,
  TRKH_TAMAT_PRL     DATE,
  TEMPOH_T           NUMBER(4),
  TEMPOH_B           NUMBER(4),
  TEMPOH_H           NUMBER(4),
  KLASIFIKASI_PRL    NUMBER(1),
  TL_ROTAN           NUMBER(1),
  PECAHAN_KESALAHAN  VARCHAR2(3 BYTE),
  TERIMA_DOSIR       NUMBER(1),
  TRKH_DOSIR         DATE,
  TRKH_SEMAK_LAYAK   DATE
Insert into prl_semak layak
   (NO_DAFTAR, EPISOD, TL_HUK, TL_KLAS, TL_JAD4, TL_KESLAIN, TL_LP, TL_RAY, TL_PPI, STATUS_LAYAK, TRKH_LAYAK_PAROL, TL_ROTAN, TRKH_SEMAK_LAYAK)
Values
   ('70201849', 9, 1, 1, 1, 1, 1, 1, 1, 1, TO_DATE('04/06/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1, TO_DATE('12/24/2012 10:46:40', 'MM/DD/YYYY HH24:MI:SS'));
Insert into prl_semak layak
   (NO_DAFTAR, EPISOD, TL_HUK, TL_KLAS, TL_JAD4, TL_KESLAIN, TL_LP, TL_RAY, TL_PPI, STATUS_LAYAK, TRKH_LAYAK_PAROL, TL_ROTAN, TRKH_SEMAK_LAYAK)
Values
   ('670500066', 5, 1, 1, 1, 1, 1, 1, 1, 1, TO_DATE('04/22/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1, TO_DATE('12/24/2012 11:03:27', 'MM/DD/YYYY HH24:MI:SS'));
Insert into prl_semak layak
   (NO_DAFTAR, EPISOD, TL_HUK, TL_KLAS, TL_JAD4, TL_KESLAIN, TL_LP, TL_RAY, TL_PPI, STATUS_LAYAK, TRKH_LAYAK_PAROL, TL_ROTAN, TRKH_SEMAK_LAYAK)
Values
   ('71000424', 3, 1, 1, 1, 1, 1, 1, 1, 1, TO_DATE('04/26/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1, TO_DATE('12/24/2012 11:11:01', 'MM/DD/YYYY HH24:MI:SS'));
Insert into prl_semak layak
   (NO_DAFTAR, EPISOD, TL_HUK, TL_KLAS, TL_JAD4, TL_KESLAIN, TL_LP, TL_RAY, TL_PPI, STATUS_LAYAK, TRKH_LAYAK_PAROL, TL_ROTAN, TRKH_SEMAK_LAYAK)
Values
   ('470900549', 1, 1, 1, 1, 1, 1, 1, 1, 1, TO_DATE('12/20/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1, TO_DATE('11/08/2010 09:15:59', 'MM/DD/YYYY HH24:MI:SS'));
Insert into prl_semak layak
   (NO_DAFTAR, EPISOD, TL_HUK, TL_KLAS, TL_JAD4, TL_KESLAIN, TL_LP, TL_RAY, TL_PPI, STATUS_LAYAK, TRKH_LAYAK_PAROL, TL_ROTAN, TRKH_SEMAK_LAYAK)
Values
   ('30906760', 2, 1, 1, 1, 1, 1, 1, 1, 1, TO_DATE('12/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1, TO_DATE('11/19/2010 08:54:26', 'MM/DD/YYYY HH24:MI:SS'));
COMMIT;i give you this sample,table creation and some insert values.So now,what i should do in order to retrieve all these records?

Similar Messages

  • How to get space between two values in a single cell of a table.

    hello,
            how to get space between two values in a single cell of a table.
    thanks a lot.
    kailash.

    sorry i got the answer.

  • How to get days between two dates

    Hi ,
    How to get days between two dates.
    Regards,
    Ramesh.

    Hi Ramesh,
    REPORT ZDATEDIFF.
    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.

  • How to get relationship between two  views in the  reports

    How to get relationship between two  views in the  reports, I am doing a deletion program , it is fully relates to views , how to get relationship between them in the reports

    Hi,
    Please explain your question in detail...what do you want to read ?
    If you want to know about the navigation links between the views then you can use APIs  like
    wdComponentAPI.getComponentInfo().findInWindows("windowName").getViewUsageByID("Name").getNavigationLinks();
    Iterate through the navigationLinkInfo from above collection and can read the other properties .
    I haven't tried the above , but it should work !!!
    Regards,Anilkumar

  • How to pass value between two forms.

    Hi all,
    how to pass value between two forms(using :parameter),...
    Thanks
    Rajesh

    To use parameters, create a parameterlist with the named parameters
    DECLARE
      pl_id PARAMLIST;
      pl_name VARCHAR2(10) := 'tempdata';
    BEGIN
      pl_id := Get_Parameter_List(pl_name);
      IF not Id_Null(pl_id) THEN
        DESTROY_PARAMETER_LIST(pl_id);
      END IF;
      pl_id := Create_Parameter_List(pl_name);
      ADD_PARAMETER (pl_id,'MYPARAMETER',TEXT_PARAMETER,:BLOCK.VALUE);      
      CALL_FORM('MYNEWFORM', NO_HIDE, DO_REPLACE, NO_QUERY_ONLY, pl_id);
    END;In the new form you can then just access the parameters via :PARAMETER.MYPARAMETER;
    An alternative is the usage of globals:
    :GLOBAL.MYPARAM:=:BLOCK.VALUE;
    -- call the emp-form
    CALL_FORM('MYNEWFORM', NO_HIDE, DO_REPLACE);and in the new form use:
    DEFAULT_VALUE(NULL, 'GLOBAL.MYPARAM');
    IF :GLOBAL.MYPARAM IS NOT NULL THEN
    ...The advantage of gloabls is that they can also return values back to the calling form, which is not possible using parameters

  • How to get value with two parameter fro sharepoint list in SSRS reporting

    Hi 
    I am using Sharepoint list and fetching data in SSRS.
    Using three parameter as Department,Section and subsection.
    with filter everything working fine,but if i use category All and Sub category all for particular department,unable to get record.
    please let me know how to implement.
    Help will be appreciated.
    Hasan Jamal Siddiqui(MCTS,MCPD,ITIL@V3),Sharepoint and EPM Consultant,TCS
    |
    | Twitter

    Hi Hasan,
    Per my understanding you want to add mutilple value parameters to filter the data in the sharpoint list datasource report, right?
    I have a test based on the step by step details information in below link and all works fine which will make the multiple value parameter works fine:
    https://audministrator.wordpress.com/2014/02/17/sharepoint-list-add-distinct-parameter-value/
    Add the custom code from above link
    Parem1 is the parameter which get values from a query and with all the values(duplicate value),please setting as below:
    Param2 is the parameter which will display in the report have done the deduplication, check the "Allow Multiple values" and then Specify the available value and default value using below expression:
    =Split(Code.RemoveDups(JOIN(Parameters!Param1.Value, ",")), ",")
    Add the filter and preview.
    Similar thread below for your reference:
    SSRS reporting with sharepoint list using Distinct and Multivalue
    parameters
    If i have some misunderstanding, please try yto provide more details information about your requirements.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • How to get difference between two rows for a column field?

    hi, all,
    Could anyone show me what query statement is to get the difference betweem two rows for two column fields?
    The tables and its records are like this:
    id,      begin,      end
    p1         21          30
    p2          45          60
    p3          120          150
    I would like to have the query result like this
    id,    diff
    p1     15    --- which is 45 minus 30
    p2     60    --- which is 120 minus 60
    and so on...
    thank you in advance.
    Raffy

    You can use the LAG function to access values from previous rows:
    with q as (select 'p1' id, 21 v_start, 30 v_end from dual
    union all
    select 'p2', 45, 60 from dual
    union all
    select 'p3', 120, 150 from dual)
    select id, v_start, v_end, v_start - lag (v_end, 1, 0)
      over (order by id) v_diff from q
    ID,V_START,V_END,V_DIFF
    p1,21,30,21
    p2,45,60,15
    p3,120,150,60
    See the SQL Language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/functions075.htm

  • How to fetch values between two days of a month

    Hi,
    I have fetch the values which are greater inserted on or after of 16th day of one and any month.
    I am trying with following query for a month of dec :
    select *
    from tablename
    where SUBSTR(TO_DATE(TO_CHAR(colname, 'DD-MON'),'DDMM'),1,6) >= '16-Dec'
    and SUBSTR(TO_DATE(TO_CHAR(colname, 'DD-MON'),'DDMM'),1,6) < '31-Dec'
    but its not giving me the desired result.
    I have to pick the resultset of everyyear.
    Please help me in this matter.

    Thanks a lot guys!!
    My problem is solved.That's good news, but be aware that the solutions presented are not all good:
    SQL> select * from tablename order by colname
      2  /
    COLNAME
    23-12-2005 11:03:12
    28-12-2005 11:03:12
    02-01-2006 11:03:12
    13-11-2006 11:03:12
    13-12-2006 11:03:12
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    31-12-2006 11:03:12
    9 rijen zijn geselecteerd.
    SQL> select colname
      2    from tablename
      3   where to_date(to_char(colname,'ddmm') || '2006','ddmmyyyy')
      4         between to_date('16122006','ddmmyyyy')
      5             and to_date('01012007','ddmmyyyy') - 1/24/60/60
      6  /
    COLNAME
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    31-12-2006 11:03:12
    23-12-2005 11:03:12
    28-12-2005 11:03:12
    6 rijen zijn geselecteerd.
    SQL> remark Mohana's solution
    SQL> select *
      2  from tablename
      3  where TO_CHAR(colname, 'DD-MON') >= '16-DEC'
      4  and TO_CHAR(colname, 'DD-MON') < '31-DEC'
      5  /
    COLNAME
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    23-12-2005 11:03:12
    28-12-2005 11:03:12
    5 rijen zijn geselecteerd.
    SQL> remark user503699's solution
    SQL> select *
      2  from tablename
      3  where TO_CHAR(colname, 'MON') = 'DEC'
      4  and ( TO_NUMBER(TO_CHAR(colname, 'DD')) >= 16
      5  and TO_NUMBER(TO_CHAR(colname, 'DD')) <= 31 )
      6  /
    COLNAME
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    31-12-2006 11:03:12
    23-12-2005 11:03:12
    28-12-2005 11:03:12
    6 rijen zijn geselecteerd.
    SQL> remark Rup's solution
    SQL> select *
      2  from tablename
      3  where TO_CHAR(colname, 'DD-MON-yyyy') >= to_date('16-DEC','dd-mon')
      4  and TO_CHAR(colname, 'DD-MON-yyyy') < to_date('31-DEC','dd-MON')
      5  /
    COLNAME
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    3 rijen zijn geselecteerd.So use user503699's solution or mine ;-)
    Hope this helps.
    Regards,
    Rob.

  • How to pass values between two pages

    also see:
    In portlets, how to use a html form passing  values to the another page?
    and
    htmlFormActionLink() method
    in common B/S developing, use html link add with a parameter or some parameters or we can submit it in a form to post values to another page .but how to do these in portal?
    I tried to write the code, but couldn't run at all!
    the provider.xml is still no problem!
    would you be so kind as to help me ?
    thanks!

    Hi Ravi,
            Using the call
    navigation->set_parameter( name='myparameter' value = myvalue ).
    you can set the page parameter myparameter to the value myvalue. This value can then be used for processing in the subsequent page.
    If the form field (in the layout part) and the page parameter are of the type string and are specified by the same name (in this case, myparameter), the following abbreviation can be used:
    navigation->set_parameter( 'myparameter' ).
    Using the set_parameter you can pass only the parameters of type string. If you wish to pass more set of values then you can call a method and then export the values of the drop down.
    Pls reward if useful.
    Thanks.

  • How to Pass values between one webdynpro application to another

    Hi ,
        I know How to Pass Values Between the Application by URL But For My Requirement NO need The Pass in URL Rather Than That Please any one TEll me How to GEt VAlues BEtween the application......
    Thanks
    ANANTH.

    If you dont want to pass values through URL, then you must have to use component Usage with interface node.
    Or you can try like this,
    by appending field value to url,
    Data w_url type string,
    w_value type string.
    get the url of calling aplication
    call method cl_Wd_utilities->construct_wd_url
    exporting application name = name of second application( to which u want to pass parameter )
    importing out_absolute_url = w_url.
    ***Make the value type compatible that has to passed with url.
    w_string = lv_pernr
    ***Now attach the parameter and its value with url that have to passed to 2nd application
    call method cl_http_Server=>append_field_url
    exporting name = 'pernr'
    value = ' w_value'
    changing url = w_url.
    then popup window for 2nd application with above url
    lo_window = lo_window_manager->create_external_application ( url = w_url ).
    lo_window -> open( ).
    ***now in wddoinit of 2nd application
    data lv_param type string
    lv_param = wdr_task=>client_window->get_parameter( ' pernr ').
    Now you can use lv_param in 2nd application.
    Regards
    srinivas

  • In BADi , How to pass the values between two Method

    Hi Experts,
    We have two methods in BADis. How to pass the value  between two Methods. Can you guys explain me out with one example...
    Thanks & Regards,
    Sivakumar S

    Hi Sivakumar!
    Create a function group.
    Define global data (there is a similiar menu point to jump to the top include).
    Create one or two function modules, with which you can read and write the global data.
    In your BADI methods you can access the global data with help of your function modules. It will stay in memory through the whole transaction.
    Regards,
    Christian

  • How can i get report between two dates?

    Hi
    how can i get report between two dates?
    for example i want get reports between 20/4/2002 & 27/4/2002.
    my table has date column and i can get first date( exam : .... where date:=a and/or ....i don't know this part)
    thanks alot.
    Regards
    The Oracle Reports Team
    http://otn.oracle.com/

    where exam_date between :from_date and :to_date
    from_date and to_date are user_parameter

  • How to calculate days between two DATES

    How to calculate days between two DATES ?
    which is the functional module for that ?
    help me

    Hi,
    use function module : it works,
    HR_HK_DIFF_BT_2_DATES
    give output format = 03 and get the value in days.
    code is as below :
    data : DATE1 type P0001-BEGDA,
    DATE2 type P0001-BEGDA,
    YEARS type P0347-SCRYY,
    MONTHS type P0347-SCRMM,
    DAYS type P0347-SCRDD.
    date1 = '20070331'.
    date2 = '20070101'.
    CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
    EXPORTING
    DATE1 = date1
    DATE2 = date2
    OUTPUT_FORMAT = '03'
    IMPORTING
    YEARS = years
    MONTHS = months
    DAYS = days
    EXCEPTIONS
    INVALID_DATES_SPECIFIED = 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 : days.
    Reward points, if helpful,
    Regards,
    Sandeep Kaushik

  • In jsp file, how to transfer parameter between two javabean?

    In jsp file, how to transfer parameter between two javabean?
    for example
    Bean1 has a attribute A
    Bean2 has a attribute B
    how to transfer the value of A to B

    Have you tried something like...
    <jsp:setProperty name="Bean2" property="B" value="<jsp:getProperty name="Bean1" property="A" />" />

  • How can get difference between 2 dates in the form of days

    how can get difference between 2 dates in the form of days

    Hi,
    Check the following program:
    REPORT ZDATEDIFF.
    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.
    Regards,
    Bhaskar

Maybe you are looking for

  • Unable to read the file using UTL_FILE Dir

    I need to read/write a file from/to the operating system through PLSQL Package. I used UTL_FILE package to do the same. In the application server the utl_file_dir(/usr/tmp in my system) is created as a softlink to database server. oI want to run this

  • Basic query - check oracle server install type

    How do I check if the Oracle 10g is configured as GENERAL_PURPOSE or TRANSACTION_PROCESSING or DATAWAREHOUSE? I searched the forums but did not find anything specific for this info. This is an existing installation, I cant find the the installation l

  • Why does AI CC 2014 "Welcome Window" contain tutorials demonstrating AI CC not 2014?

    This is REALLY confusing. I am relieved to see "smooth tool toggle" has been returned as an option for the Pencil tool in CC 2014, but the "Rebuilt Pencil Tool" video within "Welcome>New Features" is showing an old version that does NOT contain this

  • Take a section out of a picture for web use

    Hello all, First let me thank you for helping me. I am inquiring about some photo editing (web design).  I have a banner on my web build with multiple pictures with a transition between each photo. Now each photo is lets say 1200 x 320 pixels. Isn't

  • Errors Scrolling off the dos window!!

    I am using win98 and jswdk1.0.1 the error or exception are scrolling off the screen in the dos window....(where the server is running) :( Is there anywhere I can specify to show the errors on webpage it self??? becoz I am able to see only a part of i