Don't know if it is a requirement to do this in the query, but I've done
exactly what you are describing by formatting the file output using the
LJustify() and RJustify() functions possibly even the CJustfy() but that
would be odd to me.

HATH
--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-----Original Message-----
From: Phillip B [mailto:[EMAIL PROTECTED]
Sent: Monday, September 29, 2003 12:54 PM
To: CF-Talk
Subject: Re: SQL padding then to file question


I'm reaching here but could you cast the fields into a char datatype with
the specific length you need?

Phillip B.

www.LoungeRoyale.com
www.FillWorks.com
----- Original Message -----
From: "Eric Creese" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, September 29, 2003 2:41 PM
Subject: OT: SQL padding then to file question


> I have been given a task to get some data and put it into a file format
for another company with starting and end positions for each column. For
example this file requires the following
>
> name width start end
> unique id 10 1 10
> Indicator 1 11 11
> title 4 12 15
> first name 30 16 45
> mid initial 1 46 46
> last name 35 47 81
>
> ...and so on.
>
> Here is my query
>
> select
personid,companyid='I',perprefix,perfname,left(permname,1),perlname,addrline
1+' '+addrline2,city,state,left(zip,5),country = 'USA'
> from peopleroleup
> where country ='United States'
> and companyid  is null
>
> How do I pad this out? I am using SQL2k Query Analyzer.
>
>

  _____  

[ Todays Threads
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to