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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Spaces in Between Columns

Status
Not open for further replies.

renee35

MIS
Jan 30, 2007
199
I am trying to export a flat file and the specs list location and length ex:
Location Length
1-2 2
3-4 2
10-18 9

How can I add spaces in between the 2nd and 3rd column to accomodate the gap from 5-9 in the location field. Also, is there a certain way to format to make sure the fields are in the right location.

Any help is much appreciated.

Thanks a bunch!!

-T
 
Right click a column and choose the menu option to add a new one. You can resize it and leave it blank.
 
Will this be done in SQL? If so I tried to right-click it and adding a column and that isn't an option

Thanks a bunch!!

-T
 
You are wanting the empty space in the Reporting Services report, or in the SQL query?
 
Cast your columns in your query to fixed width data types.

Code:
Select
Cast(Col1 as char(2))
,Cast(Col2 as char(2))
,Space(5)+ Cast(Col3 as char(9))
From MyTable



Paul
---------------------------------------
Shoot Me! Shoot Me NOW!!!
- Daffy Duck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top