DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: REPLACE function with '

  1. #1
    jonas Guest

    REPLACE function with '


    Hi

    I am importing data from one database structure to our sql db. However in
    the LastName field, a high number of values contain an " ' " i.e. D'Arcy.


    However when attempting to use the REPLACE function, it doesn't like the
    ' character, and neither does any other sql statement. The closest i've got
    is selecting the offending records:

    SELECT [Export Patient Data].XID, [Export Patient Data].FirstName, [Export
    Patient Data].LastName
    FROM [Export Patient Data]
    WHERE ([Export Patient Data].LastName) Like "%'%";

    Does anyone have any ideas?

    Thanks
    Jonas

  2. #2
    David Satz Guest

    Re: REPLACE function with '

    please do not double post - see my response in
    database.sqlserver.general

    "jonas" <jpshelley@btinternet.com> wrote in message
    news:3df731ce$1@tnews.web.devx.com...
    >
    > Hi
    >
    > I am importing data from one database structure to our sql db. However in
    > the LastName field, a high number of values contain an " ' " i.e. D'Arcy.
    >
    >
    > However when attempting to use the REPLACE function, it doesn't like the
    > ' character, and neither does any other sql statement. The closest i've

    got
    > is selecting the offending records:
    >
    > SELECT [Export Patient Data].XID, [Export Patient Data].FirstName, [Export
    > Patient Data].LastName
    > FROM [Export Patient Data]
    > WHERE ([Export Patient Data].LastName) Like "%'%";
    >
    > Does anyone have any ideas?
    >
    > Thanks
    > Jonas




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center