dbTalk Databases Forums  

Decimal Values in Fixed Format Text Files

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Decimal Values in Fixed Format Text Files in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Robert Hamilton
 
Posts: n/a

Default Decimal Values in Fixed Format Text Files - 09-08-2005 , 05:40 PM






What is the best way to export decimal values to a fixed format text file, so
that the value is right justified as it should be? I'm getting values that
seam to be centered within the field, which makes no sense at all.

Help.

Regards,
Rob

Reply With Quote
  #2  
Old   
Robert Hamilton
 
Posts: n/a

Default RE: Decimal Values in Fixed Format Text Files - 09-09-2005 , 01:55 PM






I figured it out last night. I use the STR function to right justify numbers
in a character format with the field width and the number of decimal places.
For example, STR(Paid_Amt, 15, 2) creates a 15 character text field that is
right justified and rounds the number to 2 decimal places.

Regards,
Rob

"Robert Hamilton" wrote:

Quote:
What is the best way to export decimal values to a fixed format text file, so
that the value is right justified as it should be? I'm getting values that
seam to be centered within the field, which makes no sense at all.

Help.

Regards,
Rob

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.