Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to add simple spaces to output 1

Status
Not open for further replies.

Chuck712

Technical User
Mar 1, 2002
133
US
Being new to SQL and being up against a deadline, I have a problem that I know is simple, but I need to get this done.
I have a procedure that outputs to a text file. The results look fine in the query analyzer, but there are no spaces between the results.
What I need is to add spaces to these columns.
Here is the select statement:
SELECT
SUM(prior_count) AS prior_count ,
SUM(adj) AS adj,
SUM(adds) AS adds ,
SUM(renewels) AS renewels,
SUM(disenr) AS disenr,
SUM(deceased) AS deceased,
SUM(xfer_in) AS xfer_in,
SUM(xfer_out) AS xfer_out,
SUM(pending) AS pending
Any quick help would be appreciated.

 
SELECT
[!]Convert(Char(10), [/!]SUM(prior_count)[!])[/!] AS prior_count ,
etc....

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Good morning Denis. [wink]

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Code:
SUM(prior_count) AS prior_count,
' ' as SPACE1,
SUM(adj) as adj,
etc...

This will create a pretty ugly file though, I would take a pretty hard look at exporting it as comma or tab delimited text.

HTH,

Alex


Professor: But what about your superintelligence?
Gunther: When I had that there was too much pressure to use it. All I want out of life is to be a monkey of moderate intelligence who wears a suit. That's why I've decided to transfer to Business School.
Professor: NOOOOOOOOOOOO.
 
Ah, I like their methods much much better!
[retract previous post]

Note to self...


Professor: But what about your superintelligence?
Gunther: When I had that there was too much pressure to use it. All I want out of life is to be a monkey of moderate intelligence who wears a suit. That's why I've decided to transfer to Business School.
Professor: NOOOOOOOOOOOO.
 
Thanks so much. You know, I feel better.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top