Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Excel Distress
 
Posts: n/a
Default 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!)
  #3   Report Post  
Duke Carey
 
Posts: n/a
Default

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   Report Post  
Excel Distress
 
Posts: n/a
Default

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
space between text strings with concatenate Jeff Excel Discussion (Misc queries) 2 March 3rd 05 07:54 PM
Sort or Filter option? Mcobra41 Excel Worksheet Functions 3 February 23rd 05 08:22 PM
concatenate text and date Tara Keane Excel Discussion (Misc queries) 2 February 11th 05 06:17 PM
concatenate a text string if two different cells contain the sam. Linda G Excel Worksheet Functions 5 January 17th 05 08:53 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 01:37 AM


All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"