Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 27 Apr 2005 @ 14:46:30 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Right Aligning Character Field
 
From:   Michael Larkins

Hi Dhanraj:

This seems like a strange requirement, but I assume it has something to do with a language other than English. Regardless, you could do the following:

     , substring('                    ' from 1 for 20-char(trim(last_name)))||trim(last_name)

In my example the last_name column is defined as CHAR(20). Therefore, I used 20 spaces in the literal string of spaces inside the substring function.

Hope this helps,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023