Advertisement

03.06.2007 at 06:59AM PST, ID: 22431079
[x]
Attachment Details

SQL Server 2000, Comma problem.....saving as CSV

Asked by savache27 in Informix Database, MS SQL Server, Microsoft Excel Spreadsheet Software

Tags: sql, csv, server, comma, 2000

Hi, I'm trying to run the following query in SQL Server 2000:

Select DISTINCT (lname + ', ' + title + ' ' + fname)  AS Name, pho As Phone, (unit + ', ' + jobtitle) As UnitTitle,
eadd As Email, (room + ', '+ build) AS Location
From tbl_teldir
Order by Name ASC;

It looks right when I run the query, but when I save it to a CSV (comma seperated) the columns are off. The problem is with the jobtitle. Within the jobtitle there may or may not be a comma, for example:

Assistant Director, Greeklife

So when I string the unit and jobtitle together, I get this:

Student Activities & Organizations, Assistant Director, Greeklife

Because only a few jobtitles have a comma, when I save it as CSV it seperates the Jobtitles with the commas.......which throws them into the column with the email address. Is there anyway to keep it from seperating the jobtitles with a comma in them?
Start Free Trial
 
Loading Advertisement...
 
[+][-]03.06.2007 at 07:21AM PST, ID: 18662151

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Informix Database, MS SQL Server, Microsoft Excel Spreadsheet Software
Tags: sql, csv, server, comma, 2000
Sign Up Now!
Solution Provided By: tomerps
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.06.2007 at 07:33AM PST, ID: 18662288

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.06.2007 at 07:41AM PST, ID: 18662355

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32