Search via date field

Hello All,
I have to search record from  the DB via date field in such a way that
suppose this mounth is aug. then i have to search all record created on aug
no matter in which  year it was created.
Thanks

Hi,
Check the code
DATA: T_flight TYPE TABLE OF SFLIGHT,
      DATE TYPE SY-DATUM,
      DATE_TEMP(2) TYPE C,
      DATE_CHECK(8) type c.
DATE = SY-DATUM.
DATE_TEMP = DATE+4(2).
concatenate '____' DATE_TEMP '__' INTO DATE_CHECK.  
                 "( 1st string consist of 4 underscore
                 " and 3rd string has 2 underscore,   
                 "  as _ is the escape char for single char in open SQL )
SELECT *
  FROM SFLIGHT
  INTO TABLE t_FLIGHT
WHERE FLDATE like DATE_CHECK.
Regards,
anirban

Similar Messages

  • Problem with Date fields in Search panel

    Hi all,
    I use TP2 and in my jspx page I have a search panel with two date fields and table where the results is displayed. But there is a problem with these date fields, because when I search dates the results is nothing even I retype the date from table. Also I have other pages where this problem exist with same structure.
    Could somebody help me with some advice?
    Thanks in advance!

    Hi Frank,
    Thanks for the answer.
    I use the standart method to make search panel with drag and drop the data control to the page. The other search panel fileds work fine, only the date fileds are problem. Maybe something in view object doesn't work properly.
    Here I post the code from my page.
    <table border="1" style="margin:5px;">
    <tr>
    <td>
    <af:showDetailHeader text="ТЪРСЕНЕ" disclosed="true"
    inlineStyle="width:780px;">
    <table cellspacing="2" cellpadding="3" border="0">
    <tr align="left">
    <td align="right">
    <af:outputLabel value="#{bindings.EGN.hints.label}"/>
    </td>
    <td align="left">
    <af:inputText value="#{bindings.EGN.inputValue}"
    label="#{bindings.EGN.hints.label}"
    columns="#{bindings.EGN.hints.displayWidth}"
    maximumLength="#{bindings.EGN.hints.precision}"
    simple="true"/>
    </td>
    <td align="right">
    <af:outputLabel value="#{bindings.LNC.hints.label}"/>
    </td>
    <td align="left">
    <af:inputText value="#{bindings.LNC.inputValue}"
    label="#{bindings.LNC.hints.label}"
    columns="#{bindings.LNC.hints.displayWidth}"
    maximumLength="#{bindings.LNC.hints.precision}"
    simple="true"/>
    </td>
    <td align="right">
    <af:outputLabel value="#{bindings.AccPersonID.hints.label}"/>
    </td>
    <td align="left">
    <af:inputText value="#{bindings.AccPersonID.inputValue}"
    label="#{bindings.AccPersonID.hints.label}"
    columns="#{bindings.AccPersonID.hints.displayWidth}"
    maximumLength="#{bindings.AccPersonID.hints.precision}"
    simple="true"/>
    </td>
    </tr>
    <tr align="left">
    <td align="right">
    <af:outputLabel value="#{bindings.PersonName.hints.label}"/>
    </td>
    <td align="left" colspan="5">
    <af:inputText value="#{bindings.PersonName.inputValue}"
    label="#{bindings.PersonName.hints.label}"
    columns="#{bindings.PersonName.hints.displayWidth}"
    maximumLength="#{bindings.PersonName.hints.precision}"
    simple="true"/>
    </td>
    </tr>
    <tr align="left">
    <td align="right">
    <af:outputLabel value="#{bindings.DateFrom.hints.label}"/>
    </td>
    <td align="left">
    <af:inputDate value="#{bindings.DateFrom.inputValue}"
    label="#{bindings.DateFrom.hints.label}"
    simple="true">
    <af:convertDateTime pattern="#{bindings.DateFrom.format}"/>
    </af:inputDate>
    </td>
    <td align="right">
    <af:outputLabel value="#{bindings.DateTo.hints.label}"/>
    </td>
    <td align="left">
    <af:inputDate value="#{bindings.DateTo.inputValue}"
    label="#{bindings.DateTo.hints.label}"
    simple="true">
    <af:convertDateTime pattern="#{bindings.DateTo.format}"/>
    </af:inputDate>
    </td>
    </tr>
    <tr>
    <td align="right">
    <af:commandButton actionListener="{bindings.Execute.execute}"
    text="#{bundle.FindBtn_LABEL}"
    disabled="#{!bindings.Execute.enabled}"
    icon="/images/find.png"/>
    </td>
    <td align="left">
    <af:commandButton text="#{bundle.FindClearBtn_LABEL}"
    icon="/images/find_clear.png"
    action="#{PeopleBean.onClearVCBtn}"/>
    </td>
    </tr>
    </table>
    </af:showDetailHeader>
    </td>
    </tr>
    </table>
    Also I have a result table for the search panel, but I don't believe the problem can be there because it works fine when I search in fields different by inputDate.
    Do you have any suggestions?

  • Formatted Search for Delivery Date field in SO not working

    Hi All
    Can anyone help me as to why my formatted search is not working?
    I am currently using SAP B1A SP01 Patch 19.
    I have created a user query as follows:
    SELECT $ [$10.0.DATE] + 5
    When I add this to the delivery field within the Sales Order and bring through the saved query which I set to auto refresh when the Posting Date field changes and to Display Saved Values it doesn't work.
    Any ideas?
    Thanks and best wishes
    Gail

    HI Gail,
    If I am not mistaken you want to add days to the posting date...if that is so then try this out:
    SELECT $[ORDR.DocDate.DATE]+5 From ORDR T0 For Browse
    Set The indicator to Auto Refresh when the fields change
    Nagesh

  • Search Page by date field not showing up results

    Hi,
    I am using Jdev 11g and new to adf.
    My applciation needs a search page based on a date field.
    I created a viewcriteria for the object which expects a date field from the user.( the bind variable is of type Date)
    After this i dragged the viewcriteria as af:query (panel with table) on the jspx page.
    Now when i run the application, that is when i enter the date (calendar autogenerated by query component),
    it does not show up any results.
    My date field in the database has a timestamp attached to it, somewhere i read that the timestamp may be causing the problem.
    But i have not found any solution for this one.
    This looks very basic to me, i am sure i am missing soemthing important.
    Besides i even tried the approach of programmaticlly populating the Viewobject(by not using the any query component),
    i can see the Viewobject being populated in the logs( the row count) but on the display page, no rows are shown.
    I am sure i am doing something wrong for this one.
          AppModuleImpl am = this.getAm();
           ViewObject submittalVO = am.findViewObject("AcrSubmittallogView1");
           System.out.println("after getting VO");
           String subDate = this.getSubDate().getValue().toString();
           String query = " to_char(SubmitDtTm,'mm/dd/yyyy') = '"+subDate+"'";
           submittalVO.setWhereClause(query);
           System.out.println("QUERY>>>> "+submittalVO.getQuery());
           submittalVO.executeQuery();
          System.out.println("after executing query "+submittalVO.getRowCount());
           this.setRenderLogTable(true);But i actually want to use the built in query component instead of programmatically doing it.
    Can someone please guide me further.
    Any help will be grt.
    Thanks in advance
    ash
    Edited by: user1175461 on Jul 15, 2010 1:18 PM

    Still not working for me either, here's exactly what I'm doing.
    My query is as follows:
    SELECT
    RO.repair_line_id,
    RO.repair_number,
    SR.customer_po_number, segment1,
    trunc(RO.creation_date) as creation_date,
    I've created a Bind Variable for the creation_date as follows:
    <Variable
    Name="createDate"
    Kind="viewcriteria"
    Type="oracle.jbo.domain.Date"/>
    Which is linked to a view criteria:
    <ViewCriteria
    Name="RepairSearchVVOCriteria"
    ViewObjectName="com.services.cs.vvo.RepairSearchVVO"
    Conjunction="AND">
    <Properties>
    <CustomProperties>
    <Property
    Name="displayOperators"
    Value="InAdvancedMode"/>
    <Property
    Name="autoExecute"
    Value="false"/>
    <Property
    Name="allowConjunctionOverride"
    Value="true"/>
    <Property
    Name="showInList"
    Value="true"/>
    <Property
    Name="mode"
    Value="Basic"/>
    </CustomProperties>
    </Properties>
    <ViewCriteriaRow
    Name="vcrow1"
    UpperColumns="1">
    <ViewCriteriaItem
    Name="CreationDate"
    ViewAttribute="CreationDate"
    Operator="="
    Conjunction="AND"
    Value=":createDate"
    IsBindVarValue="true"
    Required="Optional"/>
    </ViewCriteriaRow>
    </ViewCriteria>
    I then dragged the criteria into the page. When running it I get the following:
    AND SR.customer_id =:psCustomerId) QRSLT WHERE ( ( (CREATION_DATE = :createDate ) ) )
    <ViewObjectImpl><bindParametersForCollection> [3510] Bind params for ViewObject: [com.xxx.services.cs.vvo.RepairSearchVVO]RepairSearchAM.RepairSearchVVO1
    <OracleSQLBuilderImpl><bindParamValue> [3511] Binding param "psCustomerId": 34758
    <OracleSQLBuilderImpl><bindParamValue> [3512] Binding param "createDate": 2010-02-18
    Which never brings back any data. My date's look as follows in the database:
    '18-FEB-10'
    I never get any results for the date. I've also tried using the to_char to format the date as the same format, but that always gives a variety of errors. This is driving me batty =0 Any ideas on why it never pulls back data?
    Thanks, Graeme.

  • F4 ( Search Help ) for date field  on the selection screen

    Hi Freinds,
    i have used WDR_SELECT_OPTIONS In my component, i have one date field on selection screen(BUDAT), for this date field i want seach help 
    this is my code
    create a range table for Posting Date
    lt_range_table = wd_this->m_handler->create_range_table(
                                                              i_typename = 'BUDAT' ).
    add Posting Date  to the selection
    wd_this->m_handler->add_selection_field( i_id = 'BUDAT'
         i_value_help_type = if_wd_value_help_handler=>CO_PREFIX_SEARCHHELP
                                               I_VALUE_HELP_ID = '??????'
                                               I_DESCRIPTION = 'Posting Date'
                                               it_result = lt_range_table ).
    can any one help me
    Thanks
    Srini

    hi sarbjeet 
    i created search help in dictionary and i used that search help in my program, but still its now working , any other ideas
    Thnx
    srini

  • Search help for DATE field

    HI all,
    I want to attach search help for a DATE field created in screen painter.
    For PERNR, PREM is attached. Similarly what is the statndard search help name for DATE field?
    Thanks,
    Shanthi.

    Hi ,
    Declare the date field as sy-datum ,
    parameters : date type sy-datum .
    This shud bring the standard search help for date .
    Thanks ..Get back for any issues.
    Anil

  • Query find form - customized search on a date field

    Hi All,
    I have a form which has query find behaviour enabled. When the user press on the search(torch light button) The query find form gets opened in a new canvas.
    I have a date field on the query find form. The current functionality is that
    "The form searches for the exact match on the date" but I want to have the results which satisfy <= "entered date".
    How do I achieve it in Query find form.
    Do I need to have the where condition appended in the Pre-Query on the results data block.
    Please help me with an example. Thank you.
    Srinivasa Mouli
    Edited by: 889427 on 4 Oct, 2011 11:43 AM

    Short of adding your own query extensions, you must pass in a Date
    parameter vs some stringified version.
    Paresh wrote:
    I want to query on a date field as follows
    "createDate < '2003-08-20 12:00:00:000' "
    createDate has DataType java.util.Date
    When I try to execute this query it throws UserException.
    If I use a parameter in the query string and pass a date object to execute
    method then it works fine.
    I just want to make sure that there in no way I can make the first
    approach work
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Placing date field inline to an Interactive Report search bar

    For a button I can choose "Right of Interactive Report Search Bar" option to place it inline with the IR Search bar.
    However I need to place a text fileld or select list or Date Field intead.
    Any ideas? If a template needs to be changed could you please indicate which template? I affrid the date field does not allow an option to change its templates.....
    I hope somebody would be able to help.
    Thanks in advance
    Ligon Gopinathan

    Hi,
    It will take some trial and error to get the positioning correct, but you can do the following:
    1 - Create an HTML region that is positioned at the bottom of your page (that is, make sure that it is underneath all other regions). Set the region's Title to &amp;nbsp; and the Template to "No Template"
    2 - On your datepicker, in the Label/HTML Table Cell Attributes setting, add in:
    nowrap="nowrap" id="P1_DATE_LABEL"(replacing P1_DATE with the actual name of the item).
    3 - In the region's Region Source, add in:
    <style type="text/css">
    #P1_DATE_LABEL {position:absolute; top:40px; left:450px;}
    #P1_DATE_fieldset {position:absolute; top:40px; left:500px;}
    </style>P1_DATE_LABEL is the ID you set above and P1_DATE_fieldset is the ID of the fieldset created for the datepicker by Apex. Change the top and left settings for both as required for your page.
    This outputs the datepicker in your region and then moves it to the top/left position you specify.
    Andy

  • Searching 2 years either side of a date field?

    Hi
    In my query I would like the search to be able to search 2 years either side of a specified search date in my interactive report
    select
    ROWID,
    ID,
    COLUMN1,
    COLUMN2,
    TO_CHAR(INDDOB, 'YYYY') AS NEWYEAR
    from TABLENAME
    ORDER BY INDDOB asc
    The interactive report is also using custom Javascript to offer an autocomplete search as per this thread For VC - Using multiple Autocomplete on a page?
    So I am unsure how this would work by allowing the date results to include 2 years either side of the chosen date?

    Mike many thanks for this
    INDDOB is a date field in the DB and the item name is :YEARD
    Using the following WHERE clause and a default vale of 1930 in the :YEARD item name is returning the correct result i.e. 1930 plus records from 1928,1929,1931 and 1932
    select
    ROWID,
    ID,
    INDSUB,
    INDDOD,
    INDREG,
    INDENT,
    INDDOD,
    INITCAP(INDSNAME) indsname,
    INITCAP(INDFNAME) INDFNAME,
    TO_CHAR(INDDOD, 'YYYY') AS NEWYEAR,
    DELDOC from   RAMBO.TABLENAME
    WHERE to_char(INDDOD,'YYYY') between :YEARD -2 and :YEARD +2
    ORDER BY INDDOD asc
    The problem is however when I try and change the search value in :YEARD from the default 1930 to for example 1950 (which is also in the db)
    When doing this it brings back no results? Could it be something to do with the associated code below which provides an autocomplete feature and search of the IA report as you type in the field name.
    In the :YEARD item under label and HTML table Cell attributes has the following
    onkeydown="if($f_Enter(event)){srch3($v('YEARD')); return false;}"
    and under the list of values in the definition for :YEARD is
    select distinct TO_CHAR(INDDOD, 'YYYY') from RAMBO.TABLENAME order by 1
    Also under page and Javascript is the following
    function srch2(pItem, pColumn) {  
       $.post('wwv_flow.show',
              {"p_request"          : 'APXWGT',
              "p_widget_action"     : 'FILTER',
              "p_widget_action_mod" : 'ADD',
              "p_widget_mod"        : 'ACTION',
              "p_widget_name"       : 'worksheet',
              "p_flow_id"           : $v('pFlowId'),
              "p_flow_step_id"      : $v('pFlowStepId'),
              "p_instance"          : $v('pInstance'),
              "x01"                 : $v('apexir_WORKSHEET_ID'),
              "x02"                 : $v('apexir_REPORT_ID'),
              "x03"                 : pColumn,
              "f01"                 : ['COLUMN', pColumn, '=', $v(pItem), null, 'minutes']
             function(data){
                //when the filter has been successfully applied the report has to be refreshed
                if(data=="true"){
                   gReport.pull();
       //clear the item
       $s(pItem,'');
    $(document).ready(function(){
       //hide IR toolbar
       $('#apexir_TOOLBAR').hide();
       $('#P4_AC').bind("result", function(){   
          //on selecting a value then fire the search function
          srch2(this, 'INDSNAME');
       // ac item P4_AC2
       $('#P4_AC2').bind("result", function(){   
          srch2(this, 'INDFNAME');
       // ac item YEARD
       $('#YEARD').bind("result", function(){
          srch2(this, 'NEWYEAR');
    // ac item REG
       $('#REG').bind("result", function(){
          srch2(this, 'INDREG');
    // ac item ENTNO
       $('#ENTNO').bind("result", function(){
          srch2(this, 'INDENT');

  • Search date fields in e-recruiting 3.0

    Hello.
    In the Talent Pool i am trying to create a search template with the field 'Birthdate'.
    The field appears with the mask 'AAAA.MM.DD' (in Portuguese) but when i put the value '1900.01.01' with the radiobutton 'after' there is no result search. But if i put the value '19000101' i get some results from the search.
    I have noticed that the XML indexed in TREX haves the date fields with the mask AAAAMMDD.
    Can anybody help me?
    Thankx.
    Pedro J. Oliveira

    Hi,
    The birthdate is defined in customizing 'Definition of search template elemetns' with:
    - element type: DATE
    - info category: CANDIDATE_CENTRAL_PERSON
    - field: BIRTHDATE
    - field type: F Free text
    In TREX trace file i have noticed that the following messages is written:
    "[01532] 2006-03-22 10:54:42.298 e Trex_SE      bartho.cpp(02660) : only use EQ or NE for text attributes"
    In BSP HRRCF_SEARCH/date.bsp there are 2 radiobutton that permits the user to choose from 'GE' or 'LT'.
    Can TREX search values with GT or LT expressions?.

  • Jdev 10.1.13 EA1 - search form (BC + ADF faces) with date field

    Did anyone tried to make a simple search form with BC,( just draging view form control palette to faces page?)
    Because when i did it and tried to search by one date field (for example orderDate) i got exception:
    oracle.adfinternal.view.faces.convert.ConvertException: Could not convert instance:Wed Sep 07 00:00:00 CEST 2005 of type:class java.util.Date into type:class java.lang.String
    Is it a bug?
    I tried to use converDateTime component but it haven't fixed the problem.
    Bart.

    Hi,
    Business Components doesn't perform type conversion. This is the problem I see. Basicaly the expected format is String
    Could not convert instance:Wed Sep 07 00:00:00 CEST 2005 of type:class java.util.Date into type:class java.lang.String
    Is you date field really a date field ?
    Frank

  • Deleting date field value via import

    I need to clear the value in a date field for a few thousand records. I tried doing this via import by setting the value to a space " " but it didn't work.
    Any ideas on how this can be achieved through import or otherwise would be great.
    Thanks.

    Hi Nakul,
    Try any of the following, it will hopefully work in your case:
    1) Import using excel with blank date field (no data in date field). This will erase the already existing value in the date field [provided there is no workflow that restricts such deletion of date data.]
    2) Create a temp workflow on condition "before modified record saved" and update the date field value with blank (no values in fx), do the import, this workflow will delete the existing data.
    Cheers!
    Vix

  • Problem updating a date field via UnitOfWork - TopLink 9.0.3

    Hello,
    we want to change an exisiting application that employs TopLink 9.0.3, Build 423.
    The data is stored in an Oracle 9.2.0.6.
    The specific table has a composite primary key consisting of four fields.
    I can easily create a new Object (foo)
    uow.registerNewObject(foo)
    uow.commit()
    and see the results in the database.
    If I obtain an exising Object (bar) and change an integer
    bar = (Bar) Session.readObject(Bar.class, expr);
    cloneBar = (Bar) uow.registerObject(bar);
    cloneBar.setSomething(42);
    uow.commit()
    everything is fine.
    But if I dare to change a Date field
    cloneBar.setSomethingElse(cal.getTime());
    then
    uow.hasChanges()
    returns true
    but the update does not happen. It is neither logged nor is the data changed in the database.
    Is this a known bug?
    What have I done wrong?
    How can I avoid using hard-coded SQL to update my Bar object?
    Bye,
    Stephan

    Hello,
    it is very disturbing, but I finally found the reason for this problem.
    After decompiling the Project class file (we have no source code of this third-party library), I saw that the mapping for this specific field is set to "readOnly".
    I did not know that TopLink is able to have specific fields "readOnly" and others "readWrite", but it can handle this!
    So it seems that the behaviour is not a bug but a feature :-(
    We can change the mapping before creating the session, with the result that the field is updatable.
    Have a nice day.

  • Needed Enhancement in IW31 for populating the date fields

    Hi,
    We need to populate the date fields like RELEASE DATE, TECHNICAL COMPLETION DATE via Enhancement for the Transaction IW31.
    We are using LSMW to upload the data.
    Can anyone provide more insight in this.
    Vijayanand.

    hi
    This exit is available for IW31..
    Exit Name           Description
    IWO10012            Maintenance order: Priority handling on central header
    If this is not applicable you would have to go for badi's
    To search for a badi, go to se 24 display <b>class cl_exithandler.</b>
    double click on method get_instance, get a break point on case statement.
    execute and start the required transaction in new session.
    look for variable <b>exit_name.</b> It would show the available badi's.
    Hope this helps
    if it helped, you can acknowledge the same by rewarding
    regards
    dinesh

  • Error While using date fields in HIbernate Criteraia

    I am trying a sample applciation using Hibernate with JPA. I am using annotations to map database table with Java class.I am using org.hibernate.Criteria to form where clause. My code looks as follows:
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("PERSISTANCE_UNIT");
    EntityManger em = emf.createEntityManager();
    Session session = em.getDelegate();
    Criteria criteria = session.createCriteria(MyDO.class)
    criteria.add(Restrictions.eq("myDO.date",myDO.getDate()));
    List list = criteria.list();
    I am searching the data base based on the date field (myDO is an instance of MyDO.class which contains the mapping to the data base table). While running the application first time after publishing to server, I am getting the following error. For subsequent running of the application I am not getting any error and the appliaction was running with actual results.
    JDBCException W org.hibernate.util.JDBCExceptionReporter logExceptions SQL Error: -181, SQLState: 22007
    JDBCException E org.hibernate.util.JDBCExceptionReporter logExceptions THE STRING REPRESENTATION OF A DATETIME VALUE IS NOT A VALID DATETIME VALUE
    org.hibernate.exception.DataException: could not execute query
         at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
         at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
         at org.hibernate.loader.Loader.doList(Loader.java:2223)
         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
         at org.hibernate.loader.Loader.list(Loader.java:2099)
         at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
         at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
    Can anybody help in fixing the problem.
    Thanks in advance.

    Resolved the issue by setting System date where expected

Maybe you are looking for

  • How do I stop my cursor from activating when I hover?

    I recently changed out my old trackball to the Apple Bluetooth trackpad (OS X 10.10.1 on a late 2013 Macbook Pro).  Ever since, the cursor will activate a button/link if I hover briefly (less than a second), so I'm constantly being taken to pages I d

  • Create View without inbound, outbound and navigation link

    Please look at this picture: There are: + PanelView + View 01 + View 02 + EmptyView In the PanelView, there are two buttons,  button01 and button02. When press on button01, it shows View01; when press on button02, it shows View02. Problem is: How to

  • Re: Need UEFI bios for GTX 670

    Use the attached for both. Decompress the provided .rar archive with Winrar: http://www.rarlab.com/download.htm Then flash the included file with Nvflash for dos: http://www.guru3d.com/files_details/nvflash_download.html To do so rename the included

  • My phone wont connect to itunes

    i rescently bought a macbook air and everytime i try to connect my phone to it, it connects and disconnects rapidly. please help!

  • USB Controller

    I've just bought myself a copy of ezdrummer with the DFH expansion pack but need to get myself a usb controller. From your experiances, is drum triggering better with a specific drum trigger device such as M-audio's Trigger Finger (or something simil