Using Like Operator For Parameter Fields

Hi All,
I have been figuring around this for few days, appreciated anyone know this could assit me
I have a report which having a mobile no parameter fields.
In my database, my mobile no was not a clean entry.
For eg, a standard mobile number from Malaysia was 60126143331.
1) 60 - indicate country code (MYS)
2) 12 - indicate mobile operator
3) 6143331 - indicate phone number
Usually, peoples will entry it as 6012-6143331 or 012-6143331 or 0126143331 or 60126143331. In my CR report, i have a static mobile no selection. Currently, my filter selection will be as below:
{pax.mobile_no} = {?p_mobileno}
any possible to change it to like? meaning to say, if user enter 012-6143331 it will know that this was 6012-6143331 and the records will be selected into the report.
Appreciated anyone know this could assits.
Thanks in advance.
Regards,
CK

Hi,
tq for ur prompt reply.
D value in my database r not fix, some mobile no could b 7 digits some could b up to 12 digits. But I jz want user to enter mobile no in 10 digits only. Example, mobile no in db wa 60126661233. However, user input in parameter selection could only 0126661233 without 6. In some situation if mobile no in db was 6012-6661233, user input willb only 0126661233 n this input will b match with data in db using like operator.
I m wondering can this b archieve in cr?
Tq
regards,
ck

Similar Messages

  • Error in SQL Query The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query

    hi Experts,
    while running SQL Query i am getting an error as
    The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    T2.LineText
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,T2.LineText
    how to resolve the issue

    Dear Meghanath,
    Please use the following query, Hope your purpose will serve.
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    CAST(T2.LineText as nvarchar (MAX))[LineText]
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry --where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,CAST(T2.LineText as nvarchar (MAX))
    Regards,
    Amit

  • Problem in JDBC , when using LIKE operator. - VERY URGENT

    Problem in JDBC , when using LIKE operator.
    LINE 1 : String temp = "AA";
    LINE 2 : String query = "select * from emp where EMPNAME like '*temp*' ";
    LINE 3 : Staement st = con.createStaement();
    LINE 4 : ResultSet rs = st.executeQuery(query);
    '*' character is not getting evaluated. In MS ACCESS2000 only * is accepted instead of '%'. Moreover in MS ACCESS the like operator has to be used within double quotes as a String. whereas in other databases, it accepts single quotes as a String.
    Ex:
    In MS ACCESS
         select * from emp where ename like "*aa*";
    Other Databases
         select * from emp where ename like '%aa%';
    In my situation iam passing a Variable inside a like operator and '*' is used.
    For the above Scenario, Please help me out.
    If possible Kindly let me know the exact Syntax.
    Please give me the answer as LINE1,LINE2,LINE3,LINE4,
    I have verified in JDBC Spec also, it has been specified to use escape sequence.that too did not work.
    Due to this, My project is in hold for about 4 days. I could not find a suitable solution.
    Please help me out.

    I made a LIKE clause work with M$ Access, using PreparedStatement and the % wildcard:
                escapeStr                   = "%";
                String sql                  = "SELECT USERNAME, PASSWORD FROM USERS WHERE USERNAME LIKE ?";
                PreparedStatement statement = connection.prepareStatement(sql);
                statement.setString(1, ("user" + escapeStr));
                ResultSet resultSet         = statement.executeQuery();
                while (resultSet.next())
                    System.out.println("username: " + resultSet.getObject("USERNAME") + " password: " + resultSet.getObject("PASSWORD"));

  • How to use LIKE operator in plsql

    Hi
    I wanted to select certain rows using like operator in plsql(Input should be given by the user). I have given my experiment here .I couldn't get any result.
    As per sql syntax while using LIKE operator we should give search criteria within single quote.where as in plsql if we give within single quote its takes as string so no output is comming.what is solution ? How to use like operator in plsql?
    sql syntax
    SQL>SELECT customer_name FROM customer_header
    WHERE customer_name LIKE 'B%' ; customer_name
    Bala murali
    Babu
    Basker
    plsql syntax
    PROCEDURE pro_custheader_like ( v_cname IN varchar2
         ,answer OUT type_refcur_customer) IS
         BEGIN
         OPEN answer FOR
         SELECT customer_name FROM customer_header
              WHERE customer_name LIKE ( ' v_cname ' );
    END pro_custheader_like;
    execution command
    sql>variable answer refcursor;
    sql>set serveroutput on
    sql>exec package_name.pro_custheader_like( 'R',:answer);
    plsql successfully completed
    sql>print :answer
    no row selected
    by
    balamuralikrishnan.s

    plsql syntax
    PROCEDURE pro_custheader_like ( v_cname IN
    varchar2
    ,answer OUT
    type_refcur_customer) IS
    N
         OPEN answer FOR
         SELECT customer_name FROM customer_header
    WHERE customer_name LIKE ( v_cname );
    END pro_custheader_like;
    Try it without any quotes. And, let us know your feedback.
    Regards.
    Satyaki De.
    Message was edited by:
    Satyaki_De

  • How to pass variable into lov sql query using like operator

    hi.
    i want to use a lov where i want to pass a variable using like operator.
    my query is
    select empno,name from table where empno like ':ed%';
    my empno is A001 TO A199 AND B001 TO B199 so i want show either A% or B% empno
    how can i do this ?
    reagrds

    kindly press Shift+F1 at a time you face this error to see the exact Oracle error message.
    and provide us with that detail
    and its better if you start new topic for that error... because that will be new error,,,
    -- Aamir Arif
    Edited by: Aamiz on Apr 7, 2010 12:27 PM

  • How tio use like operator in textitem to get the name

    Oracle forms6i
    Hai All
    I have created an form to create an hierarchy list. I that I had an Text_item how can i use like operator to get the name to select. which trigger i need to use. when i select the name i need to get his employee code and other details
    Thanks In Advance
    Srikkanth.M

    A is the head of Dept 10 and three person are under A namelyHow will you know that B, C and D are under A is there any parent child relationship between Leader and Employee code? If yes, Then you can create the relationship between blocks no need to set where_clause programatically. So, relationship can be like...
    leader_block.emp_code = emp_block.leader_code
    AND leader_blokc.dep_code = emp_block.dep_codeSo, when you will query data in LEADER block it will show employees which are under LEADER which you queried in LEADER block.
    Or if there is no relationship then how will you know that which employee under which leader?
    b 002 10 1
    c 003 10 1
    d 004 10 1
    When i enter the name of head corresponding other members in the department will need to display in the
    Tabular format Or if you want to query the records only for department relation. Then as you said you create two blocks then create create the relationship using dep_code between those blocks.
    like...
    leader.dep_code = emp_block.dep_code-Ammad

  • How can we provide F4 help for parameter field.

    Hi All,
    How can I provide F4 help for parameter field.
    Regards,
    Amar

    hi,
    different ways of applying search help are :
    you can use anyone:
    1)   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    or
    2) 
    can follow these simple steps for search help:
    go to se11==> put some name after ticking search help radiobutton==> create==>
    then tick " elementery search help " and press enter ===>then put description and table name in selection method ===>then put the field on which u want search help
    in search help parameter==> tick IMP EXP ==> write 1 in lpos and spos===>save and activate===> double click on table name ===>  select that field and press *search help tab* above===> then copy
    3 )
    methods of applyind search help:
    For search help sometimes we use MATCHCODE----->when we apply it directly to parameter or select option.they are obselete now ii.For search help sometimes we CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' ??------->if we want to populate data of internal table as search help.
    iii.For search help sometimes we declare tablename-fieldname in selection?------>if that field in that table is having seach help or check table ..F4 will be avaliable directly.
    also:
    Fixed value of domain can also work as search help.
    i hope it will help u a lot
    thaks and regards
    rahul sharma

  • Where can i see whether employee is active or inactive?   while i am running retirement action  i have used lis9 operation for 0001,007,0008.but its not delimited.can anyone help me?

    my client asked me " how to see emploee is active or inactive" for head count    plz help me.

    Hi,
    Try to use 'COP' operation for the Infotypes. We can check in PA30 main screen the status of the employee provided if we have configured the status to be visible in the screen. We can also check in table PA0000 the status of the employee - STAT2 field will provide the status information.
    Thanks,
    Sriram

  • Get Result using LIKE operator

    Hi All,
    I am bit confused as to how to get this output using like operator :
    select * from table1 where name like 'P&C%';
    Here , since '&' is there , sql is prompting me to enter a value for C instead of giving output. I tried using escape but it is not working.
    Can anybody tell me how to overcome this problem..?
    Thanx.

    Alright,
    Here you go. In 'SQL Editor' in PL/SQL Developer:
    Pulled this off the PL/SQL Developer Manual:
    Escape character
    If you wish to use an ampersand in the SQL text that should not be interpreted as a substitution variable,
    use a double ampersand instead. The following example will retrieve all employees from the ‘R&D’
    department:
    select * from emp
    where emp.deptno in (select dept.deptno from dept
    where dname = 'R&&D')
    order by empno desc
    If the text 'R&D' had been used instead, you would have been prompted for the D variable.

  • How to use like operator in loop

    Hi I am trying to use like operation in loop condition. the code is as follows:
    loop at lt_mara into l_mara where l_mara like '%XXX'.
    endloop
    when i have the like operator like above its giving me an error that i cannot use like operator. Is there anyway that i can use like operation in loop at condition,
    Thanks in advance

    using the ranges with CP option we can do that..
    Populate the ranges mentioned below..
    data: r_matnr type range of matnr,
            w_matnr like line of r_matnr.
    w_matnr-low = '%XXX'.
    w_matnr-sign = 'I'.
    w_matnr-option = 'CP'.
    append w_matnr to r_matnr.
    loop at lt_mara into l_mara where matnr in r_matnr.
    endloop
    Regards
    Vijay Babu Dudla

  • How to change heading text  for parameter field of type date

    Hi,
        After creating a parameter field with the type " Date Time" when I open the report for entering the parameter then it displays  the given parameter with the following text:
    " Please enter Date in format "yyyy-mm-dd". "
    I want to change it to some other text like as:
    " You have to enter the date and time in format yyyy-mm-dd . "
    Is there any way by which I can change this given header to some other text.
    Let me know if anyone needs some more information in this regard so as to solve my given query soon.

    Hi Garrett,
                  Well first of all I can change only the prompt text that is user defined. I cannot change any parameter as of now whose type is let suppose Date. Since in this case the Business Object itself shows the text which is something like this " Please enter Date in format "yyyy-mm-dd". " .
       Here I want to change this given text to some other format like " You have to enter the date in the format yyyy-mm-dd" or in any other manner.
    Also the current Crystal Report version which I am using is 11.0.0.1282.

  • How to use select statement for one field

    I want to fetch the data from table and only one field  , the below code i written is correct or not , because only for one field i used endselct  if i am not giving endselect it is  showing error. Please suggest me.
    DATA : SBELN TYPE VBAK-VBELN.
    parameters : s_vbeln type vbak-vbeln.
    select vbeln from vbak into sbeln
    where vbeln = P_VBELN.
    endselect.

    Hi ,
    As because you want single field but not single record so SELECT  SINGLE is not correct .
    You need to create a internal table with the field of VBELN.
    Then you need to fetch the records from the VBELN field of table VBAK.
    Try this code --
    DATA : t_itab like table of VBAK-VBELN.
    parameters : s_vbeln type vbak-vbeln.
    select vbeln from vbak into table t_itab
    where vbeln = s_VBELN.
    Regards
    Pinaki

  • How to use LIKE operator with PreparedStatement

    Hi, I need to execute a query with the LIKE operator, but using a PreparedStatement. Can I do this, and if so what must my SQL look like with the wildcard characters '%' or '_'?
    normal PS example: conn.prepareStatement("select * from mytable where name like ?");
    If I try: conn.prepareStatement("select * from mytable where name like ?%");
    I get: ORA-00911: invalid character
    If I try: conn.prepareStatement("select * from mytable where name like '?%'");
    I get: ORA-01006: bind variable does not exist
    I must use a PreparedStatement, as my variable may contain illegal characters (like '), and using PreparedStatement.setString(1, var) will automatically escape it for me.
    I could also use a normal Statement, but I need to escape my var ... is there a utility that will safely escape a String for an Oracle VARCHAR2??
    Thanks in advance,
    Stu Miller

    Hmm, it seems you are right...
    when my variable contains a '%' symbol, the PreparedStatement will NOT escape it, and thus it is treated like a wildcard. Therefore, I can just do
    pstmt.setString(1, var+"%");
    But, that may return more results than I'm asking for, as when 'var' contains a '%' symbol it is taken as a wildcard too.
    I need each character in my variable to be taken literally, and only add a wildcard at the end. Basically, I need a STARTSWITH operator ;-)
    It seems to me that escaping the sensitive characters in a String (which will differ depending on which operator is used), should be possible. I could write this, but I was hoping Oracle had already done it for me in some utility class.

  • Using like Operator in Prepeared Statement

    PreparedStatement s2=dbcon.prepareStatement("Select phone,dnc_message from gsw_donotcall_list_tab where phone=? or dnc_message like ?");
    s2.setString(1,number);
    s2.setString(2,"%"+smessage+"%");
    ResultSet result=s2.executeQuery();
    rowfound=result.next();
    (Using SQL Server, I am Accepting Parameters from the User by a HTML Page, the user may enter full or partial message, but need to display all the records Satisfying the Criterai
    I tried this but dosnt work for DNC_message Field
    Can anyone help me i am in great need of this

    The problem with that is it produces the following query:
    UPDATE COFFEES SET SALES = 75 WHERE COF_NAME LIKE 'Colombian'Which they also show as a normal Statement (rather than a PreparedStatement) and they claim it will work. Well, in most databases it will work, only if COF_NAME contains exactly "Columbian", just like an "=". If you also want it to return "Columbian Prime" or "Wild Columbian" or whatever, your out of luck without the wildcards, and PreparedStatement does not insert them. If you don't belive it works this way, then test it yourself:
    create table TEST_IT (
      Bogus VARCHAR(20) Primary Key
    insert into TEST_IT values ('AAA');
    insert into TEST_IT values ('ABA');
    insert into TEST_IT values ('ABC');
    SELECT * From Test_It Where Bogus LIKE 'A';
    SELECT * From Test_It Where Bogus LIKE 'AAA';
    SELECT * From Test_It Where Bogus LIKE '%A%';And inspect what the three select statements return.
    Edit: I must apologise, and ask the OP what Driver he is using. This may be somewhat Driver dependent. Using the MySQL 3.1.6 Driver and MySQL 4.1.9, it did not escape the "%" symbols and so
    setString(1, "%A%");returned 3 rows. So the reason yours is not, may be dependent on the Driver and/or vendor. But in any case, the example shown in the tutorial (the Statement version) would still not work (at least in most DBs).

  • Set default value for parameter fields

    Good day!
    Situation:
    1. I have 2 parameter fields in reports (dateFrom and dateTo)
    2. Before running report in ASP.NET I change value this fields (dateTo = today, dateFrom = today - 3 days)
    3.I use for this source:
    foreach (ParameterField crParam in CrystalReportSource1.ReportDocument.ParameterFields)
                            CrystalDecisions.Web.Parameter crParametr = new CrystalDecisions.Web.Parameter();
                            string ParametrName = crParam.Name;
                            crParametr.Name = ParametrName;
                              crParametr.DefaultValue = ActionReportParameter.GetParametrValue(ReportName, ParametrName);
                             CrystalReportSource1.Report.Parameters.Add(crParametr);
    4. And repurt run without request value parameter fields.
    5. BUT!!! now I need request value parameter fields before report start running - I want set default values for filelds and offer user change its before report start run.
    How do this?
    Thanks

    I believe you need to create your own parameter promt screen. Capture what the user entered and pass that to the report(?).
    slv

Maybe you are looking for

  • Deletion of Returns Sales Order

    Hi Guru's I have created one return sales order with reference to one invoice and after that with reference to that returns sales order i have created credit invoice. Now my query is that can i delete the returns sales order? If yes please let me kno

  • "disp+work" process in not getting started after kernel upgradation

    Hello Experts, Good day….., I am new to SAP. I installed SAP ECC6 EHP4 with default kernel version 701 and it was working fine. I have upgraded kernel version from 701 to 741, but the “disp+work” process is not getting started after kernel upgrade. I

  • IPod Classic Won't Display Notes or Contacts

    After I installed iTunes 11.1.0.126, my notes and contacts don't display on my iPod Classic.  I have the "enable disk use" option checked on iTunes. I have manually saved txt files saved to the Notes folder and vcf (vCard) files saved to the Contacts

  • White lines appear on OAM placed in InDesign

    Hello. This is my first post in the forums. I've just placed my first OAM file into an InDesign folio. The initial/downstage image views great in both Edge Animate and InDesign but once the folio is uploaded and viewed on a tablet device horizontal w

  • How to transfer settings from WRT310N (in use) to AC1750 (EA6500) (new)?

    Is there an easy, automated process to transfer existing router configuration/settings from a (currently in use) WRT310N to a new AC1750 (EA6500) (brand new, not currently in use)? I am hoping not to have to do it manually ... Thanks!