+ Reply to Thread
Results 1 to 4 of 4

How do I concatenate text that actually contains quotation marks?

  1. #1
    Excel Distress
    Guest

    How do I concatenate text that actually contains quotation marks?

    I'm building tiresome SQL statements by concatenating text and cell contents.
    I need to be able to insert double quotation marks into the actual text
    strings for concatenation. Excel won't allow this because to concatenate the
    strings themselves, they must be enclosed in double quotation marks.

    Example: =CONCATENATE("extvalue"&C1174&" "&D1174&",") gives me "extvalue211
    Legal Name," when what I actually want is "extvalue211 "Legal Name"". (And
    no, I don't want to rename all my SQL column headers to contain underscores
    and no spaces!)

  2. #2
    Bob Phillips
    Guest

    Re: How do I concatenate text that actually contains quotation marks?

    =CONCATENATE("extvalue"&C1174&" """&D1174&""",")

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Excel Distress" <Excel [email protected]> wrote in message
    news:[email protected]...
    > I'm building tiresome SQL statements by concatenating text and cell

    contents.
    > I need to be able to insert double quotation marks into the actual text
    > strings for concatenation. Excel won't allow this because to concatenate

    the
    > strings themselves, they must be enclosed in double quotation marks.
    >
    > Example: =CONCATENATE("extvalue"&C1174&" "&D1174&",") gives me

    "extvalue211
    > Legal Name," when what I actually want is "extvalue211 "Legal Name"". (And
    > no, I don't want to rename all my SQL column headers to contain

    underscores
    > and no spaces!)




  3. #3
    Duke Carey
    Guest

    RE: How do I concatenate text that actually contains quotation marks?

    In addition to Bob's suggestion, you can also use CHAR(34) to put double
    quotes into a string

    I understand you don't want to change your column names, but the MVPs on the
    SQL Server newsgroup are VERY militant about that subject, indicating that
    using spaces in column names is contrary to best practice.

    "Excel Distress" wrote:

    > I'm building tiresome SQL statements by concatenating text and cell contents.
    > I need to be able to insert double quotation marks into the actual text
    > strings for concatenation. Excel won't allow this because to concatenate the
    > strings themselves, they must be enclosed in double quotation marks.
    >
    > Example: =CONCATENATE("extvalue"&C1174&" "&D1174&",") gives me "extvalue211
    > Legal Name," when what I actually want is "extvalue211 "Legal Name"". (And
    > no, I don't want to rename all my SQL column headers to contain underscores
    > and no spaces!)


  4. #4
    Excel Distress
    Guest

    RE: How do I concatenate text that actually contains quotation mar

    Thanks v much for all solutions. And now I have figured out I can put
    underscores as well if I really want (per the SQL Server Police
    recommendation):
    =CONCATENATE("extvalue"&C1171&" "&SUBSTITUTE(D1171," ","_")&",")
    I'm good to go!

    "Duke Carey" wrote:

    > In addition to Bob's suggestion, you can also use CHAR(34) to put double
    > quotes into a string
    >
    > I understand you don't want to change your column names, but the MVPs on the
    > SQL Server newsgroup are VERY militant about that subject, indicating that
    > using spaces in column names is contrary to best practice.
    >
    > "Excel Distress" wrote:
    >
    > > I'm building tiresome SQL statements by concatenating text and cell contents.
    > > I need to be able to insert double quotation marks into the actual text
    > > strings for concatenation. Excel won't allow this because to concatenate the
    > > strings themselves, they must be enclosed in double quotation marks.
    > >
    > > Example: =CONCATENATE("extvalue"&C1174&" "&D1174&",") gives me "extvalue211
    > > Legal Name," when what I actually want is "extvalue211 "Legal Name"". (And
    > > no, I don't want to rename all my SQL column headers to contain underscores
    > > and no spaces!)


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1