How to exclude characters

Within my query, I have a WHERE statement:
WHERE Left(t_item,2) NOT LIKE '%-'
AND Left(t_item,2) NOT LIKE '_%'
This was to exclude the underscore character. I was told this
was the only non number or letter used. Of course now I am finding
out that this is not true and many other characters are used. Is
there a way for me to alter this to say that the left 2 character
MUST be either a letter or a number.

Doesn't look like you can't refer to your column alias in
your WHERE clause.
SELECT DISTINCT Left(t_item,2) AS series
FROM dbo.ttiitm001#companyNumber#
WHERE Left(t_item,1) IN
('0','1','2',...'O','P','Q','R','S','T','U','V','W','X','Y','Z')
AND Right(Left(t_item,2),1) IN
('0','1','2',...'O','P','Q','R','S','T','U','V','W','X','Y','Z')
ORDER BY 1
--or perhaps--
SELECT DISTINCT Left(t_item,2) AS series
FROM dbo.ttiitm001#companyNumber#
WHERE Left(t_item,1) IN
('0','1','2',...'O','P','Q','R','S','T','U','V','W','X','Y','Z')
AND Substring(t_item,2,1) IN
('0','1','2',...'O','P','Q','R','S','T','U','V','W','X','Y','Z')
ORDER BY 1
--or--
SELECT DISTINCT Left(t_item,2) AS series
FROM dbo.ttiitm001#companyNumber#
WHERE Left(t_item,1) IN
('0','1','2',...'O','P','Q','R','S','T','U','V','W','X','Y','Z')
AND Mid(t_item,2,1) IN
('0','1','2',...'O','P','Q','R','S','T','U','V','W','X','Y','Z')
ORDER BY 1
Phil

Similar Messages

  • REGEXP - How to exclude word

    Hi,
    i wanted to know how to exclude a part of word when matching word.
    For example i want to exclude all words that begins with 'bc_'
    I tried a regular expression like '^(?!bc_).*' but it doesn't seem to work
    Does anyone have an idea ?
    Thx.

    Hi,
    Welcome to the forum!
    Whenever you have a question, it helps if you post some sample data and the resutls you want from that data.
    You can post the sample data in the form of a WITH clause, like Blushadow did, or as CREATE TABLE and INSERT statements:
    CREATE TABLE     table_x
    (      x_id     NUMBER (2)
    ,      txt     VARCHAR2 (30)
    INSERT INTO table_x (x_id, txt) VALUES (1,  'bc_name');
    INSERT INTO table_x (x_id, txt) VALUES (11, 'xxx');
    INSERT INTO table_x (x_id, txt) VALUES (12, 'xxbc_xxx');
    INSERT INTO table_x (x_id, txt) VALUES (13, 'bcxxx');When posting the results (or any formatted text) type these 6 characters:
    \(all small letters, inside curly brackets) to keep this site from compressing the spaces.
    Given the data above, are these the results you want?X_ID TXT NEW_TXT
    1 bc_name new_name
    11 xxx xxx
    12 xxbc_xxx xxbc_xxx
    13 bcxxx bcxxx
    If so, you don't need regular expressions, and it will be more efficient not to use them:SELECT x_id
    ,     txt
    ,     CASE
         WHEN txt LIKE 'bc\_%' ESCAPE '\'
         THEN 'new_name'
         ELSE txt
         END          AS new_txt
    FROM     table_x
    ORDER BY x_id

  • How to exclude salary arrears from pension deduction?

    I have setup a pension retro element and its calculating the retro amount correctly.
    However, its using sum of salary arrears (say,arrears for the month of March and April) and adding that to May salary and deducting pension on the total sum.
    (we do not want this, we want only May salary to be considered for pension retro element)
    Does anyone know how to exclude salary arrears from pension deduction element? Is there any obvious step, which I am missing in while defining the element?

    Hi,
    While doing retro for arrears, it will give at a time in one payroll only, no standard for installment payments.
    2nd option:
    Calculate the Total Arrears amount and divide it by four installments and through IT 0014 with New wage type and give for 4 months as start and end date.
    * you have to create a new wage type which is taxable and assigned to IT 0014.
    * add this new wt in Remuneration form in Earnings side.
    Regards,
    Praneeth kumar

  • How to exclude open items by credit exposure calculation

    Dear all,
    as anybody idea about how to exclude by the credit exposure calculation some old items (in our case all items having document date lower than 01.10.2005).
    These are the basic assumptions:
    i cannot use a special G/L indicator because some of them already have one and i cannot change it;
    i cannot use the reason code field because it doesn't appear on all items (e.g., negative amount open items, and some others)
    some items are positive, some other are negative, some have a special g/l indicator and some others not.
    therefore i am forced to change rules of calculation. Is there any user exit o bte?
    thanks a lot!
    Edited by: Alessandro Casarico on Aug 31, 2010 8:36 PM

    Alessandro
    I think your only option is 'user exits for credit checks':
    LVKMPTZZ
    LVKMPFZ1: USER_CREDIT_CHECK1
    LVKMPFZ2: USER_CREDIT_CHECK2
    LVKMPFZ3: USER_CREDIT_CHECK3
    Good luck.

  • How pass ext characters to a stored proc by odbc when enable sqlserver syntax is on??

    how pass french characters or extended characters to a stored procedure by odbc
    error: ORA-01756: quoted string not properly terminated
    une chaine entre apostrophhes ne se termine pas correctement
    oracle Retrieving extended characters thru ODBC
    PL/SQL procedure parameters
    hi, i hope you can help to me.
    I have a problem with french and german characters.
    i have a little stored procedure than return what i'm passing to him.
    see these example: (the second one work fine on plsql)
    first exemple:
    1) i created a new odbc dsn
    2) i'm going into sqlserver migration tab to choose
    Enable Exac Syntax.
    3) i'm open Winsql (this is a odbc tools)
    http://www.indus-soft.com/winsql/
    4) i'm write
    exec ksp_test 0,'HiLLO ORACLE'
    i receive this error:
    Error: ORA-01756: quoted string not properly terminated
    (State:S1000, Native Code: 6DC)
    I trying to changed too the NLS_LANG in the registry
    like FRENCH_CANADA.WE8ISO8859P1
    French_France.WE8ISO8859P1
    but without any success..
    i got the same problem with
    oracle 9 database with utf8 characters set.
    oracle 8.1.7 with iso8859p1 characters set.
    i trying all latest odbc driver from oracle website.
    second exemple:
    SQL> variable mytest refcursor;
    SQL> exec ksp_test (0,'HiLLO ORACLE',:MYTEST);
    PL/SQL procedure successfully completed.
    SQL> PRINT MYTEST;
    Your Database Value
    HiLLO ORACLE
    CREATE OR REPLACE PACKAGE KSP_PLSQLRSETPKG
    AS
    TYPE RCT1 IS REF CURSOR;
    END;
    CREATE OR REPLACE PROCEDURE KSP_TEST (
    PATCH INT DEFAULT 0,
    PONC VARCHAR2,
    RC1 IN OUT KSP_PLSQLRSETPkg.RCT1
    AS
    BEGIN
    OPEN RC1 FOR
    SELECT PONC "Your Database Value" FROM DUAL;
    FROM DUAL;
    RETURN ;
    END;
    i'm trying also different nls setting but no good result.
    AMERICAN_AMERICA.US7ASCII
    AMERICAN_AMERICA.WE8MSWIN1252
    FRENCH_CANADA.WE8DEC
    FRENCH_CANADA.UTF8
    FRENCH_CANADA.WE8MSWIN1252
    FRENCH_FRANCE.WE8DEC
    FRENCH_FRANCE.UTF8
    FRENCH_FRANCE.WE8MSWIN1252
    is working well on sqlplus but not by odbc..
    also..
    i'm declare a variable and
    i set
    v_variable := 'id'
    and the procedure return the good syntax...
    i think is a odbc driver problem....
    the driver don't want to accept a extended characters set by a parameters coming from the procedure.
    can you confirm to me ..this is a major bug for the driver..
    my procedure is very basic to make a little test.
    did you try my procedure to be sure you have the same problem?
    i try with a oracle instance utf8,WE8MSWIN1252 and
    i got always the same problem.
    if i write insert into test values ('di');
    everything is fine...but when i call the procedure...
    the procedure don't want to accept any german..french or any extended characters...
    our application is working by odbc driver.
    i'm pretty sure is a bug in the driver ...the bug is coming only when i select "ENABLE EXEC SYNTAX" IN THE DSN (SQLSERVER MIGRATION SECTION) ... i try with Shema Database and Owner and Empty and i got
    always the same problem
    exec KSP_TEST 0,'TiEST'
    ------------------------>>>>>>>NOT WORKING.
    BUT IF I WRITE
    CALL KSP_TEST (0,'TiEST')
    ------------------------->>>>IS WORKING
    if i select enable exec or i unselect enable exec...
    the CALL KSP_TEST...... is always working properly.
    BETWEEN THESE SYNTAX THE NLS_LANG IS NEVER CHANGED....
    IS WORKING.....THE NLS_LANG IS GOOD.......because i make a little modification in procedure to be sure the INSERT IS inside the database CORRECTLY.
    CREATE OR REPLACE PROCEDURE KSP_TEST
    PATCH INT,
    PONC VARCHAR2
    AS
    v_test varchar2(100);
    BEGIN
    v_test := 'test';
    INSERT INTO YYY VALUES (PONC);
    END;

    If  "just using Crystal Reports XI R2" means using Crystal Report Viewer and do not want to see the prompt, please follow the below steps.
    1. Select the report you want to see
    2. Select "Process" tab
    3. Select Parameters menu under the process tab.
    4. You would see two date parameters there.
    Select the [Empty] value for each parameter and fill out the value you want.
    Hope this would help.

  • How to exclude stock of a particular storage type from collective availabil

    How to exclude stock of a particular storage type from collective availability check in MDVP.

    you can set the storage location as 'Storage location stock excluded from MRP' value '1' in the field
    Sloc MRP indicator , in MRP view $ when you enter a storage location accessing the material master.
    Thsi is the only way to exclude the storage location, you have to do it per each material and also it is excluded from the MRP.
    With this option the stock is not considered in ATP.
    IF you need the storage location in the MRP, then you should consider the use of MRP Areas.
    With the MRP Areas you define which plants/storage locations belong to each MRP area and the ATP is performed for eah area with the stocks that exist in each of them.
    Please if the issue is solved set the thread  as answered and provide the points to the useful replies.
    thanks for your cooperation

  • How to exclude one or more than one member on report?

    Post Author: izhar
    CA Forum: WebIntelligence Reporting
    Hi all group members, I am working on BOXI R2. I have to ask that, How to exclude one or more than one member from the report. I know there is function of filter, through which we can see our desired members and other remaining will be excluded, but that's filter. In some of tools i have seen just do right click on a specific member and click on "Exclude" option to exclude the member. Suppose i have placed a Time dimension on the report and standing on "Month Level" which has data from 1, 2, ... 7,8, ... 11, 12 Now i just have to exclude member 7 from the report. Can any member guide me here. Regards, Izhar

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    Izhar,
    If you run the report in "modify" mode, then you have two options
    1) You can click on the "Show/Hide Filter Pane" button which opens up the "apply filter" pane.  From there you go to your Data panel and grab, drag, and drop an item from the Data panel into the apply filter pane and provide a constant or select a value to filter in or out from your report.
    2) You can highlight the column of data that you want to filter on, then click on the "Add Quick Filter" button.  Using the List of Values menu you either select one or multiple items that you want to include in the report.

  • How to exclude sales office for combination sales order type/division?

    Hi experts,
    I would appreciate if you could advise: How to exclude sales office for combination sales order type/division in ECC 6.0 ?

    Hi
    Standard SAP functionality would not be able to cater to this. Ideally create a Z table with sales order type and sales office combination. Put in entries for combinations that are allowed. In Sales order program MV45AFZZ use the exit USEREXIT_MOVE_FIELD_TO_VBAK. In this exit write down the logic passing the sales office determined and the order type and check if the entry is there or not. If the entry is there then it should go on to the next step. If it does not then pass an error message. You need to use the help of your ABAP er for this.
    Thanks
    Indranil

  • How to exclude two kind of files in the same folder in sender cc?

    Hi,gurus:
    Now we are using "advanced selection for source files" in sender file adapter.
    Our requirement is as below:
    The source directory is  c:\test and there are many files in the directory.
    We want to transfer all the files except aa.txt and bb.txt.
    We have to implement it in one scenario,but it couldn't work.
    It worked only when we transferred all the files except aa.txt or bb.txt,but not work when we want to transfer except aatxt and bb.txt.
    I checked the blog "XI/PI: how to exclude files in a sender File adapter?",but it is not the same issue.
    Any help will be appreciated.

    Hi,
    The only way to solve your purpose is
    Provide the list of file names like c. d. e. f. whatever possible number of file names in the "File Name Mask" column and provide the directory names by clicking on plus for additional rows. just dont use aa.* and bb. anywhere.This will do your purpose.
    Thanks!

  • How to Exclude a sub directorys from polling using FileAdapter of BPEL Proc

    Hi all,
    I have a BPEL process with file adapter which is polling to root folder .
    I want to exclude File polling for some of the sub folder of the BPEL process.
    How to exclude file polling for sub folder i know the option is available for file name not for folder.
    Thanks
    Phani

    dude, you have to give the exact name of the folder you want to poll to,
    you can also pass the location of the folder at runtime/dynamically.
    In 10 G only single location can be polled by single file adapter
    in 11 g we can poll different folders by single file adapter
    However I doubt that there can be selective polling to multiple folder.

  • How to exclude the backup of a drive in vmware mirage server

    I want to ask that how to exclude the backup of a drive in vmware mirage server.

    I have developed an environment called VDI(Virtual Desktop Infrastructure) in which user is assigned a drive(i.e. D:).When I use to take backup of D: drive then by default with D: drive mirage server use to take backup of C: drive too.That's why i want to exclude the backup of C: drive .Please help me out to solve this.

  • How to exclude synchronous interfaces from component based message alerting

    Hi Pi experts,
    We are configuiring Alerts in PI 7.3 single stack.If we have 'n'number of interfaces, and if we configured general alerts for all.How to exclude synchronous interfaces in that.Alerting is for asynchronous interfaces only.How to do that.
    Please advice on this.
    Regards
    Suneel

    Hello,
    >>What are your approaches regarding this requirement in the context of java-only?
    I would suggest you to schedule jobs like this:
    Customize Alerts Using Job in PI 7.31/PO
    >> alerts are consumed according to the given interval and not in "real time" when error occurs, today solution using BADI is "real time" - if possible I would prefer "real time" solution
    Check this:
    Michal's PI tips: How to trigger an alert for Component Based Message Alerts (CBMA) via "API" ?
    >>an separate service determine the actual alert count would be helpful to provide the correct value for maxAlerts, this have to be called beforehand
    I haven't tried it but i think u can do that, since these consumers are nothing but JMS queues only so i think there will be a method to read number of alert counts.
    >>In history I saw emails generated by the standard alert consumer which only contain details for the first alert, in my case I need details especially the message id for all errorneous messages
    If ur max alert parameter is greater than 1 then u should see multiple alert text  (along with message id and other details) in ur email message.
    Thanks
    Amit Srivastava

  • How to exclude statistic using Data Pump API?

    How to exclude all statistics while exporting data using Oracle Data Pump API (DBMS_DATAPUMP package)?

    You would call the metadata filter api like this:
    dbms_datapump.METADATA_FILTER(
    handle = your_handle_here,
    name = 'EXCLUDE_PATH_LIST',
    value = 'STATISTICS');
    Hope this helps.
    Dean

  • How to exclude a set of materials from  cycle counting physical inventory

    How to exclude a set of materials from  cycle counting physical inventory
    Details:
    Set of material to be uploaded to SAP on say Jan-2011  from another system with cc indicator D:once
    in a year  and fixed,before uploading into SAP physical inventory will be done .
    So we donot want again those materials to fall in the cycle counting in the same year.
    So is there a method to exclude these materials from CC counting for the year 2011
    or is there some way to upload last inventory count date in SAP system so that it will exclude those
    materials?
    Any answers will be appreciated.
    Thanks
    Bijay

    HI Antony
    Thank you for your reply.
    If material count is less than this method is well valid.
    IN our case there are 7lakhs materials and having diff cc indicator A,B,C,D...
    So it will cumbersome for client to keep track of all those materials when to update cc indicator.
    So any other thought? can we upload last count date while updating materials details  or similar
    Thanks
    Bijay

  • OBIEE 11g How to Exclude/Include Multiple columns on BI Report at Run Time

    OBIEE 11g How to Exclude/Include Multiple columns on BI Report at Run Time

    Exclude:
    you Can exclude columns in either Table view or pivot table view by placing those columns in Excluded section but you will notice that it will appear in bi server parsed sql query.
    Not sure you were asking about runtime??
    would you please explain your question!!
    Thanks
    NK
    Edited by: DNK on May 8, 2013 9:48 PM

Maybe you are looking for

  • Video Input choices

    I'm playing DVDs created on DVDSP from a laptop to a flatscreen HDTV. Which is the best option quality-wise (there's no VGA input on the TV): S-Video Component (Can you even do component from a laptop?) Thanks, Jonathan

  • Embedding fonts into movie

    Hi all I have a projector into which I embedded some fonts using the following commands: Insert>Media Element>Font. I chose the option to include the entire character set. After I embedded the fonts, all the spaces between the words in the movie show

  • FRM-92101: There was a failure in forms server during startup

    Hi All, I installed application server 10g R2 couple of days ago. I am facing FRM-92101: There was a failure in forms server during startup. This could happen due to invalid configuration. Please look into the web server log file for the details. I a

  • Hi, I have two problems:

    Hi, I can't open any links from my Mail app. When I tap on links in my email it doesn't open the link via Safari. In fact, it doesn't act as it did before.

  • IPhoto Auto open/import

    Everytime I connect my new iPhone 3G to my Mac (running Tiger) - it syncs and opens iPhoto. iPhoto then invites me to import all the images on the iPhone. Can I do one of two things: 1) Can I stop iPhoto from opening on connection? or 2) Is it possib