Like operator with PowerQuery

Hi Everyone
Please help me to construct a PowerQuery With help of LIKE operator SQL Query
Below is my sample Query
select * from
abc where
LastModifiedDate
like
'2012-02-06%'
Thanks In Advance..

Hi
Not sure if you are trying to:
use Like in a PQ, in which case Chris Webb's blog is very helpful  Implementing A Basic LIKE/Wildcard Search Function In Power Query or
are you trying to pass a parameter through to a SQL Query in which case I just posted a suggestion to a similar question here How
to pass date dynamically to SqlQuery in PowerQuery
Hope this helps

Similar Messages

  • LIKE Operator with Clobs

    Hi, Having Problems using the LIKE Operator with the Clob Datatype. Does any one know if its possible.
    Thanks
    Emer

    It's not possible.
    try use DBMS_LOB.INSTR instead...

  • 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.

  • LIKE operator with 2 words

    I have a search box, the contents of the search field are then used in a LIKE operator statement:
    SELECT * from Products WHERE product_name LIKE '% + productName + %';
    this works perfectly fine for one word i.e. Fruit
    but when i try Fruit Cake i get no matches i have to add Fruit%Cake in the textfield. I'm not sure how to add the percentage sign in between when there's two words. Any ideas?

    but when i try Fruit Cake i get no matches i have to
    add Fruit%Cake in the textfield. I'm not sure how to
    add the percentage sign in between when there's two
    words. Any ideas?Use a simple String.replace() to replace whitespaces with the % sign.

  • How to use LIKE Operator with my query requriment

    HI all,
    I have a requirement as follows
    EMPID ENAME JOB SAL
    10 RAJ KAMAL MANAGER 25000
    20 KAMAL RAJ NAYAK CLERK 4000
    30 NARENDAR GUPTA ANALYST 20000
    40 ASHUTOSH GUPTA DEVELOPER 10000
    50 ASHUTOSH NAYAR PROGRAMMER 15000
    i am searching enames such that i need to get the whole name even if i search with just a single LETTER/WORD immaterial of the order they exist in the name for which i need to get the whole name.(INFACT WORD comparision)
    ex:
    1) select * from emp where ename like '%ka%'
    i am getting:
    10 RAJ KAMAL MANAGER 25000
    20 KAMAL RAJ NAYAK CLERK 4000
    This is not what i need i need just word camparision not letters comparision let me tell you...
    select * from emp where ename like '%amal%'
    Even for this query ill get the same output.. this is not my option to go..
    I need just word comparision with starting letter and immaterial of the word position in the name
    If it is possible to do with query please let me know..
    Thanking you
    Narendar Vishwanatham

    Full example:
    SQL> ed
    Wrote file afiedt.buf
      1  with e as (select 10 as empid, 'RAJ KAMAL' as ename, 'MANAGER' as job, 25000 as sal from dual union all
      2             select 20, 'KAMAL RAJ NAYAK', 'CLERK', 4000 from dual union all
      3             select 30, 'NARENDAR GUPTA', 'ANALYST', 20000 from dual union all
      4             select 40, 'ASHUTOSH GUPTA', 'DEVELOPER', 10000 from dual union all
      5             select 50, 'ASHUTOSH NAYAR', 'PROGRAMMER', 15000 from dual)
      6  -- END OF TEST DATA
      7  select *
      8  from e
      9* where regexp_like(ename,'(^| )KA( |$)')
    SQL> /
    no rows selected
    SQL> ed
    Wrote file afiedt.buf
      1  with e as (select 10 as empid, 'RAJ KAMAL' as ename, 'MANAGER' as job, 25000 as sal from dual union all
      2             select 20, 'KAMAL RAJ NAYAK', 'CLERK', 4000 from dual union all
      3             select 30, 'NARENDAR GUPTA', 'ANALYST', 20000 from dual union all
      4             select 40, 'ASHUTOSH GUPTA', 'DEVELOPER', 10000 from dual union all
      5             select 50, 'ASHUTOSH NAYAR', 'PROGRAMMER', 15000 from dual)
      6  -- END OF TEST DATA
      7  select *
      8  from e
      9* where regexp_like(ename,'(^| )KAMAL( |$)')
    SQL> /
         EMPID ENAME           JOB               SAL
            10 RAJ KAMAL       MANAGER         25000
            20 KAMAL RAJ NAYAK CLERK            4000
    SQL>

  • Using like operator with attributes in select command

    Hi,
    I have a table with the attributes as DID, PNO,AGE, DEPARTMENT, DATEOFADM, CHARGES, ADDRESS, DOD
    I want to display the records with the months in DOD and DATEOFADM same. How can I do so? I also want to do the same with the dates in the 2 attributes.
    Thanks
    Edited by: 1004111 on May 23, 2013 1:51 AM

    Hi,
    Please read SQL and PL/SQL FAQ
    When you put some <b>code or output</b> please enclose it between two lines starting with {noformat}<b></b>{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    You should post create table and insert statement for your requirement.
    You can check if 2 dates have the same month in either way:-- this is comparing year and month
    SELECT *
    FROM yourtable
    WHERE TRUNC(dod,'MM')=TRUNC(dateofadm,'MM');
    -- or in case you want to compare only months no matter the year
    SELECT *
    FROM yourtable
    WHERE EXTRACT(MONTH FROM dod) = EXTRACT(MONTH FROM dateofadm);
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Using the LIKE operator with wildcards to match names

    I am using SQL in ColdFusion 9 to match names in an MS Access 2003 database table.
    The Visitors field of MyTable contains the name "Smith" in six records.
    1. Smith Jones Wilson
    2. Smith, Jones, Wilson
    3. Smith(Jr.), Jones, Wilson
    4. Jones Wilson Smith
    5. Wilson Smith Jones
    6. Smith
    7. Smithson, Jones, Wilson
    8. Jones, Wilson, Arrowsmith
    To find out which records contain the name Smith (but not Smithson or Arrowsmith) I now need to write four "OR" lines:
    WHERE MyField LIKE 'Smith[!a-zA-Z]%'  (finds only the Smiths in records 1, 2 and 3)
             OR MyField LIKE '%[!a-zA-Z]Smith'  (finds only the Smith in record 4)
           OR MyField LIKE '%[!a-zA-Z]Smith[!a-zA-Z]%' (finds only the Smith in record 5)
           OR MyField = 'Smith'   (finds only the Smith in record 6)
    I would like to know how to combine these four lines into one which would find all six records containing Smith.
    Thank you for your help.

    As this is a SQL-specific question, you might be better off asking it on a SQL forum?  Does Access even support regexes?
    For a CF the regex you'd be after "\bsmith\b".  You should read the Access regex reference to see if it supports this.  A CF regular expression is no use to you here as the comparison needs to be done on the DB,  not in CF.
    Adam
    Misread the question.  Revising.

  • Like operator and byte[ ]

    hello,
    how to use Like operator with byte[ ]
    byte[] buff= myString.getBytes("UTF-8");
    String query="SELECT * FROM Person WHERE Firstname LIKE ? "
    ps = getConnection().prepareStatement(query);
    ps.setBytes(1, buff);
    rset = ps.executeQuery(); thanks

    no effect
    byte[] buff= myString.getBytes("UTF-8");
    String query="SELECT * FROM Person WHERE Firstname
    LIKE ? "
    ps = getConnection().prepareStatement(query);
    ps.setBytes(1, new String(buff));
    rset = ps.executeQuery();
    What a complete and utter bunch of crap.
    You are back to not having wildcards again.
    God knows what is in myString.
    And of course you still haven't posted your result set processing code which if it is the same garbage as before will do you no good whatsoever.
    Crap.
    What exactly is the problem here? Another copy and past programmer in over their heads with a deadline looming or what?

  • EJB QL "LIKE" OPERATOR NIGHTMARE

    i want to pass input parameter to my ejb ql.
    it will look like this :
    "SELECT OBJECT(p) FROM EntityBeanTable p WHERE p.Title LIKE ?1"
    But it seem its imposible with ejb 2.0. am i right ?
    how to overcome this then,
    "LIKE" operator is so damn important, without this we can't continue our development.
    shall we use bmp ? or ????

    You can use the like operator with parameters, you just have to put your wildcards into the parameter. Here's an excerpt:
    A query that uses a LIKE operator would look something like this:
    SELECT DISTINCT OBJECT(user)
    FROM User user
    WHERE user.userInfo.lastName LIKE ?1
    If you check out the code in the code listing on the left-hand side of this panel, you will
    note that a method exposes this functionality from the UserManagement session bean
    so that you can access it from the client with the getUserByLastNameLike()
    method. Thus, to use getUserByLastNameLike(), you can specify the pattern
    string as a parameter.
    For example, to find users with last names like "High", you would pass the following
    parameter value:
    users = userMgmt.getUserByLastNameLike("High%");

  • [VB] Like operator not functioning?

    I'm trying to create the following statement in my VB code, but I'm getting a "Sub or Function not defined" error. My question is, how do you use the Like operator with InDesign scripting? InDesign doesn't seem to recognize the Like operator.
    "myCurrentString" contains a letter.
    If myCurrentString Like "[A-z]" Then
    End If
    I'm also trying to do the following:
    If myCurrentDigit Like "[0-9]" Then
    End If

    I couldn't find "RegExp" in the InDesign script model--could you give a bit more information about what this is? I don't know how to iterate through the contents of an XMLElement as individual character objects, so I'm iterating throught XML.contents, putting each character in a basic string variable. I need a way to put strings into a With statement, or a Like operator. I haven't had success with either technique.
    Here's an example:
    strTime = myCurrentXMLElement.contents
    strTime = Trim(strTime)
    strLength = Len(strTime)
    For counter = 1 to strLength
    strTemp = Mid(strTime, counter, 1)
    [This is where I need to find out if strTemp is a letter or a digit]
    Next

  • Case Insensitive Search coupled with "LIKE" operator.

    Greetings All, I am running Oracle 11gR1 RAC patchet 25 on Windows X64.
    This db supports and application that requires case insensitive searches.
    Because there are a few entry points into the db I created an "after login" trigger:
    CREATE OR REPLACE TRIGGER MyAppAfterLogon_TRGR
    AFTER LOGON
    ON DATABASE
    DECLARE
    vDDL VARCHAR2(200) := 'alter session set nls_comp=''linguistic''';
    vDDL2 VARCHAR2(200) := 'alter session set nls_sort=''binary_ci''';
    BEGIN
    IF ((USER = 'MyAppUSER') OR(USER = 'MyAppREPORTINGUSER')) THEN
    EXECUTE IMMEDIATE vDDL;
    EXECUTE IMMEDIATE vDDL2;
    END IF;
    END MyAppAfterLogon_TRGR;
    This ensures that everyone connecting to the DB via any mechanism will automatically have case insensitive searches.
    Now, to optimize the know queries I created the standard index to support normal matching queries:
    select * from MyTable where Name = 'STEVE';
    The index looks like:
    CREATE INDEX "CONTACT_IDX3 ON MYTABLE (NLSSORT("NAME",'nls_sort=''BINARY_CI'''))
    This all works fine, no issues.
    The problem is when I write a query that uses the "LIKE" operator:
    select * from MyTable where Name like 'STEV%';
    I get back the record set I expect. However, my index is not used? I can't for the life of me get this query to use an index.
    The table has about 600,000 rows and I have run gather schema stats.
    Does anyone know of any issues with case insensitive searches and the "LIKE" clause?
    Any and all help would be appreciated.
    L

    I think there is issue with your logon trigger :
    "IF ((USER = 'MyAppUSER') OR(USER = 'MyAppREPORTINGUSER')) THEN"
    it should be :
    IF UPPER(USER) = 'MYAPPUSER' OR UPPER(USER) = 'MYAPPREPORTINGUSER' THEN
    because user name stored in Upper case. Check and try.
    HTH
    Girish Sharma

  • Like operator issue with on Number column

    Hi,
    Query with like operator for Example: " where RATE LIKE ('%2%')"
    the result of the query returns rows which contains "2" as part of field value along with few rows which are updated recently, but do not contain 2 in that row.
    In the table data type of COLUMN is Number, no precision.
    Pls let me know if any one knows about this.
    --satya.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Can you please post the result of the query you are using?
    Regards

  • Multiple row subquery with like operator

    can any1 give me an example where we can use a multiple row subquery with the like operator.I read it can be used but when i tried it gives the following error
    select * from gagan_emp where ename like (select ename from gagan_emp where deptno=10)
    ERROR at line 1:
    ORA-01427: single-row subquery returns more than one row

    The right part of 'LIKE' is permitted only single value expression
    (including subquery that returns single value),
    is not permitted multiple values.
    -- Examples (but.... not so good)
    select * from gagan_emp e0
    where exists
    (select ename from gagan_emp e1 where deptno=10
    and e0.ename like e1.ename)
    select * from gagan_emp e0
    where exists
    (select ename from gagan_emp e1 where deptno=10
    and e0.ename = e1.ename)
    select * from gagan_emp e0
    where ename = any
    (select ename from gagan_emp e1 where deptno=10)
    select * from gagan_emp
    where ename like
    (select ename from gagan_emp e1 where deptno=10 and rownum=1)
    ;

  • How to move Firefox4 Tabs to the Bottom like opera the userChome.css #content tabbox { -moz-box-direction: reverse; } does't work ,and tabmix extension is s incompatible with Firefox 4.

    ''Duplicate post, continue here - [https://support.mozilla.com/en-US/questions/780590]''
    I want move Firefox tabs to the bottom like opera
    but the code of userChome.css
    #content > tabbox { -moz-box-direction: reverse; }
    does'nt work,
    and tabmix can do this,but current version of tabmix is incompatible with Firefox 4.

    You can get the development version of Tab Mix Plus which works with Firefox 4 from http://tmp.garyr.net/forum/viewtopic.php?t=10888
    The author of Tab Mix Plus has stated that he is almost ready to release a new version of Tab Mix Plus.

  • Problem with LIKE operator in select query

    Hi,
    I want to compare one field using LIKE operator. But i m not able to do that.
    DATA: l_doctext type c value ''''.
    CONCATENATE l_doctext s_lbktxt-low '%' l_doctext INTO s_lbktxt-low.
    SELECT bukrs belnr gjahr blart bldat budat xblnr bktxt waers awtyp
                FROM bkpf INTO TABLE g_t_bkpf_labor
                FOR ALL ENTRIES IN g_t_bseg_unique
                WHERE bukrs = g_t_bseg_unique-bukrs
                AND belnr = g_t_bseg_unique-belnr
                AND gjahr = g_t_bseg_unique-gjahr
                AND blart = p_ldtype
                AND bktxt LIKE s_lbktxt-low.
    plz help. Am i dng something wrong.
    Value in s_lbktxt can be like 'TEA.....'

    hi ,
    check this program..
    tables:mara.
    data: begin of it_mara occurs 0,
          matnr like mara-matnr,
          meins like mara-meins ,
          mtart like mara-mtart,
          end of it_mara.
    select-options: s_matnr for mara-matnr.
          select matnr
                 meins
                 mtart
                 from mara
                 into table it_mara
                 where matnr like '%7'.
    sort it_mara by matnr.
    loop at it_mara.
    write:/ it_mara-matnr,
    it_mara-meins,
    it_mara-mtart.
    endloop.
    regards,
    venkat.

Maybe you are looking for

  • Using substring function in the dashboard prompt

    Hi, I want to use a function in the dashboard prompt. Example: Subject Area:Paint --> Products --> Color I want to take second letter of color, describe a label for it and use this label in prompt. The formula is below; CASE WHEN (SUBSTRING(Products.

  • Safari web history only goes back to a certain point.

    Safari web history only goes back to a certain point. Hello. My Safari web history only goes back in time to a certain point. Everything beyond that (quite a substantial history) is at the same date and time. I need to ascertain the time stamped brow

  • Indexing crawled content

    The latest endeca ATG integrated module donot use developer studio for configuring record adaptor. I would like to know how to configure and index third party data source with JDBC connection or csv file or even craweld content.

  • Migrating Informix IIF 2000 (IDS 9.21) to Oracle 8i/9i

    There is a lot of information available on migrating from Informix 7.3 to Oracle but their does not seem to be any info on migrating from Informix 9.21 to Oracle. Has anyone had any experience with this migration? I would like to know the differences

  • Can't turn off crossfade?

    Just got a new iPod Nano 6th G, and I can't turn off crossfading! Every time I skip tracks, it crossfades the old one into new. I have the 'Audio Crossfade' options in Settings -> Music turned off, and it still crossfades. Is there some setting in iT