How do I pull out a portion of a string?

I have over 2,000 emails in mySQL database with company names as well. Unfortunately, these subscribers do not enter the company name the same. So I came up with the idea to pull the company name from the right side of the @ symbol, ie: [email protected] But try as I may, I have not been able to figure out how to do this. Can anyone help me out here?

If you assume the company name will always exactly match the domain name, you could do this in a WHERE clause of your query.  Assuming you submit a form to start the email process, and the form has a field called "CompanyName":
<CFQUERY Name="Get" datasource="#application.dsn#">
      SELECT email
      FROM users
     WHERE email LIKE <cfqueryparam value="%@#form.CompanyName#.%" cfsqltype="cf_sql_varchar">
</CFQUERY>
NOTE: If you are submitting queries and passing values into the query based on user input (like FORM or URL variables), ALWAYS use CFQUERYPARAM to prevent SQL Injection attacks.
Anyway, this should select all the user email addresses that contain the company name between the "@" and "." characters.  It will also not give false positives when searching for "Dell" and there are email addresses with domains like "silverdell.com" or "delltaco.com".
-Carl V.

Similar Messages

  • How can i pull out data from a spreadsheet only from the current month?

    Data is constantly being fed into a spreadsheet using a VI, this data comprises of such things as month, year, weights, std dev, etc.  I want to do some data manipulation on the current months data while the VI is running, how can I pull out only the data relating to the current month?  Each input into the spreadsheet stores the values for that run on one row, and there are perhaps 150 runs each month
    Any thoughts are greatefully received
    Thanks
    Ross
    Attachments:
    Results.xls ‏1 KB

    Hi Ross,
    I thought I would go away and make you an example VI for the results xls that you have sent me.
    Here it is:  I have added a few comments here and there but if you need more info please don't hessitate to post back on the forum
    Hope if helps
    AdamB
    National Instruments
    Applications Engineering Team Leader | National Instruments | UK & Ireland
    Attachments:
    MonthExtract.vi ‏43 KB

  • How can I pull out this calendar to schedule report

    Hi expert,
          there is no calendars for report scheduling in infoview, please have a look at attached file. how can I pull out this calendar to schedule report.
    Many Thanks,

    Hello Zhang,
    You have to create the calendar in the CMC then use it when scheduling.
    See KB article https://bosap-support.wdf.sap.corp/sap/support/notes/1651984
    Regards,
    Monia.

  • How to sync/pull out 'phymyadmin' data into power pivot?

    Hi,
    i work for a one of the leading e-commerce companies in India. ( Lenskart.com ). I have just installed powerpivot and looking forward to using my database /crm data into power pivot as the data is into millions.. i have login info of my server/db . rest
    i do not knwo how to configure that to powerpivot so that i can pull out that data in powerpivot excel.. need hel to set it up..
    thanks..

    Hi Pranay,
    This is the set-up I use also. 
    You need to make sure you first have the ODBC MySQL Connector installed on your machine (presuming you are Windows):
    http://dev.mysql.com/downloads/connector/odbc/ 
    WINDOWS
    Then you need to go into "ODBC Data Sources". IF you are using Windows 8 or above simply type this into the start screen. Make sure you select the correct version i..e 64-bit if you are running a 64-bit system. 
    Click 'Add...'
    Choose your driver, for me this is 'MySQL ODBC 5.3 Unicode Driver'.
    Click "Finish".
    You well then be prompted with a configuration screen, the only info I have needed is:
    Data Source Name
    TCP/IP Server
    Port (usually 3306)
    User
    Password
    Database
    Click 'Test' to make sure the connection is working. In the past I have errors which were caused by my IP address not being added to the allow list on the server firewall, so be wary of this. 
    Click 'OK' and that is your connection done. 
    POWERPIVOT
    In powerpivot open your data model and then select 'From Other Sources'
    Choose 'Others (OLED/ODBC)'
    Enter a name for the connection.
    Click 'Build'
    Click the 'Provider' tab
    Click 'Microsoft OLD DB Provider for ODBC Drivers'
    Click 'Next'
    From the 'Use Data Source Name' select the data source you created above.
    Click 'Test Connection' 
    Click 'OK'
    Click 'Next'
    You will then have the option to either write your own query to extract data or to select from a list of tables. 
    Hope that helps!

  • How do you blur out a portion of a video in Premiere Elements 3.0?

    I need to know how to blur out parts of a video in Prem. Elem. 3.0.  Your help is appreciated!

    One of the best Track Matte Keying tutorials that I have ever found is Curt Wrigley's. His is built around PrPro and "softening skin tones," but translates well to "hiding identity," etc. It can be found HERE.
    Good luck,
    Hunt

  • How can I pull out the pics out of my iPod?

    The deal is that I accidently deleted the folder where I had my pics. So I wanna get the pics that I have in my iPod to my computer! SOmeone knows how to do this??? Thank's!!

    If you did not check the copy oroginal resolution pictures to the ipod, you cannot.

  • How can i pull out my home button ?

    my home button is locked inside the ipod is like sitck inside. I don't know how it happen but i would like to know how to fix it

    See:
    fix for Home button
    Fix a broken, unresponsive or sticky iPhone Home Button

  • Report for pulling out data of Pricing Ref. Material

    Hi All,
    I want to know the transaction or report which can pull out the data of pricing ref. material used for any material in Sales Org .2 view. I mean to say that, if there are 100 materials created and 50 of them have a pricing material field populated by some xyz material then how can I pull out those 50 material numbers for which the pricing ref. material is populated along with the pricing ref. material number?
    Await your quick response.
    Hrishikesh

    Hi
    These are  the standard reports for the material related.
    Material Analysis-Incoming orders - MC(E
    Material Analysis- Invoiced Sales - MC+Q
    Material Returns-Analysis - MC+M
    But i think you need to go for LIS , by creating a user defined report where in you need to take the character sics as pricing reference material (MATNR) as one of them
    Regards
    Srinath

  • How do I show multiple rollover images on a page inserted dynamically (pulled out of a sql database

    How do I show multiple rollover images on a page inserted dynamically (pulled out of a sql database table) using Dreamweaver’s Repeat Region. Example: I have different products each one associated (through their productID) with two images (one that’s showing in the page and one for the rollover effect) that are pulled from a database using Dreamweaver’s Recordset. So I want to end up with a page containing row after row of images(one for every product).When moused over each image will reveal the second (rollover) image for the same product which in turn can be a link(the image itself ) that when clicked leads to a detailed page with more information about the product the image is associated with. To show row after row with images for the different products in the database table I am using Dreamweaver’s Insert Rollover Image command and then the  Repeat Region – I have no problem to complete the steps, to insert the image and the rollover one at once and set the paths so they are pulled dynamically depending on the productID they are associated with .I have also no problem to apply the Repeat Region so not only the first image associated with the first product in the table is shown but all of them-a routine and standard procedure when using the Repeat Region to dynamically generate and display multiple rows of data. However, when I preview the page the rollover effect is lost –the images are shown but when moused over the second  image does not  show. The problem is caused when the Repeat Region is applied-once again I am allowed to apply it but the rollover stops working, a kind of interference. ANY SOLLUTION PLEASE, ANY WORK AROUND.

    I gotta tell you, using multiple images for rollover effects is going to be a big challenge in your dynamic scenario. 
    If this were my product page, I would use thumbnails with a bit of CSS opacity or filters to desaturate and make them full opacity/color on mouse over.  Nice effect with much less bandwidth. Easily done globally with CSS code.
    Two examples:
    http://alt-web.com/GALLERY/GalleryTest.php
    http://alt-web.com/TEMPLATES/CSS-Semi-liq-photo-sheet.shtml
    Nancy O.

  • How do I get a disc out of my super drive when I forgot to eject it from the drive before pulling out the USB cable ?

    how do I get a disc out of my super drive when I forgot to eject it from the drive before pulling out the USB cable ?

    How force eject disc: Apple Support Communities
    Mac Mini: Eject DVD Apple Support Communities

  • I have a brand new macbook pro that i was doing a data transfer from an old macbook, it got stopped/cable pulled out, now have spinning wheel of death that wont stop, how do i reboot/stop the wheel of death and start again?

    i have a brand new macbook pro that i was doing a data transfer via firewire from an old macbook, it got stopped/cable pulled out, now have spinning wheel of death that wont stop, how do i reboot/stop the wheel of death and start again? (this time il use time machine transfer)

    Just power off the machine(s). Shut them down. Migration Assistant gets 'stuck' sometimes - best way to migrate really isn't over Firewire, though it will certainly work, but with both machines hardwired via Ethernet to the same router. You can use a TM backup, too, of course, provided that it's recent. Which is the best? Your choice. I've done it both ways and have a preference for MA, but TM restore can be a bit faster and less quarrelsome.
    Clinton

  • Ever since the up dates... Any of my photos that I use and want to set as wall paper... The software blows the picture out of portion and no way of cropping it and keeping it at the regular size!!!! How can this be fixed!!

    Ever since the up dates... Any of my photos that I use and want to set as wall paper... The software blows the picture out of portion and no way of cropping it and keeping it at the regular size!!!! How can this be fixed!!???

    Hope this helps:
    http://ios.wonderhowto.com/how-to/fixing-ios-7-wallpaper-woes-scale-crop-align-d esign-perfect-iphone-background-0148750/
    Please reply with any further questions.

  • Can any one tell me how to pull out a sealed management pack key token

    Hi All,
    Can any one tell me how to pull out a sealed management pack key token. I want to add dependencies to a management pointing towards a sealed management pack for which a "management pack key token" is required which i need to add in the XML File
    of the management pack. Can any one please tell me how to fetch that information.

    Hi Gautam,
    If you need to reference one management pack in another management pack, then you will need to know what the public key token is. When referencing a Microsoft management pack, it is easy as Microsoft always have the same key which is 31bf3856ad364e35 but
    if you need publickey token for other then MS management pack then you can simply run a SQL querry in your OperationManagerDB.
    select * from dbo.ManagementPack where MPName = 'Type your ManagementPackID'
    ManagementPackID will be present of the properties of the Management Pack.
    In that case the management pack should be imported in your SCOM environment.
    And you will get Public key token only for sealed Management packs not for unsealed.

  • HOW TO PULL OUT THE PAPER TRAY ON ENVY e4500

     I HAVE JUST BOUGHT  HP ENVY 4500 e ALL IN ONE, I AM HAVING TROUBLE FINDING OUT HOW TO PULL OUT THE PAPER TRAY.
    This question was solved.
    View Solution.

    To pull it out to load paper, you first flip down open the front door (which is connected to the paper tray and serves as the output tray), then grab on the door and pull.
    ======================================================================================
    * I am an HP employee. *
    ** Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue. **
    ***Click on White “Kudos” STAR to say thanks!***

  • How to pull out productivity report ?

    Dear SAP Pros,
    How does a person pull out the Productivity report in SAP ? There is a user in Infrastructure Logistics who does not know how to pull out the Quaterly Productivity Report .
    Thanks,
    D

    Hi,
    A little clarification required here. What are they expecting on the report?
    For production orders have a look at transaction COOIS.
    Regards,

Maybe you are looking for

  • Mac book air thunderbolt (mini display to VGA)

    my office projector doesn't support my new mac book thunderbolt output(mini display to VGA) but works well with my old mac book pro (2011)

  • How to create an Alert Service using Oracle9i wireless?

    Hi All, I wanted to create an alert based service on oracle9i...but i am unable to figure out from where should i start doing..i am under basic confusion of how this whole system actually works..how to configure my service..can any body suggest me...

  • Missing namespace on XAI Inbound Service Fault Element

    Hi, when a XAI Inbound service errors out, it uses the Fault element defined in the WSDL, which normally should be: +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">+ +<soapenv:Body>+ +<soapenv:Fault>+ +<faultcode>soapenv:

  • Acrobat Reader problem in mini-PC

    Hello, I have a mini PC, and can't use some preference settings in Adobe Acrobat Reader due to too small screen. For example, I can´'t see the OK-button.  Adobe has no scrollbar. Anybody who know how to solve this problem?

  • Msiscsi.sys crashing in Windows 2008 R2 Datacenter x64

    After enabling MPIO for ISCSI one of our HyperV Clustered Windows 2008 R2 Datacenter x64 servers has been unstable, crashing 3-5 times daily.  I've had to take it out of service and after analyzing the dump file it seems there is an issue with msiscs