Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 DTS

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-04-02 : 20:26:06
Vinayak writes "Hi

I have created text file through DTS (export)with following select statement
----------------------------------------
select

CONVERT(CHAR(12), ISNULL(TRAN_ID, SPACE(12)))"TRAN_ID",
CONVERT(CHAR(7), ISNULL(TRAN_LN_NUM, SPACE(7)))"TRAN_LINE",
CONVERT(CHAR(7), ISNULL(TND_CD, SPACE(24)))"CUST_ID",
CONVERT(CHAR(25), ISNULL(BUS_DT, SPACE(25)))"BUS_DT",
CONVERT(CHAR(24), ISNULL(SCAN_ID, SPACE(24))) "SCAN_no",
CONVERT(CHAR(7), LTRIM(ISNULL(TRAN_TYP,SPACE(7))))"TRAN_TYP",

CONVERT(CHAR(17), ISNULL(QTY, SPACE(17))) "QTY",
ISNULL(CAST(RTL_PRC AS VARCHAR), SPACE(21)) "RTL_PRC",

cast((ISNULL(ISNULL(RTL_PRC,(0)) * ISNULL(qty,(0)) + isnull(disc_amt, (0)), space(21))) as varchar) "Sold At",

CONVERT(CHAR(24), ISNULL(ACCT_NUM, SPACE(24))) "ACCT_NUM"

from transaction
where bus_dt = '04/02/01'

order by tran_id, tran_ln_num
---------------------------------------------

I am geting output but all fields are left justifed and i want it right justifed.

How can i get it.

Thanks.
Vinayak"
   

- Advertisement -