Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sat, 22 Sep 2002 @ 01:42:19 GMT


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


Subj:   Phone number matching from dec to char
 
From:   Burton, Bruce

I have two tables to match by phone number. Phone number in either case is in a standard 10 byte format with npa, nxx, line.

table 1 phone# decimal(10,0)
table 2 phone# char(10)

I've tried casting phone1 as char(10) and phone2 as dec(10,0) but no luck matching...comes up with a truncation error when casting phone1 as char(10) and comes up with 'bad data' when casting phone 2 as dec(10,0).

I finally got the match to work when I did a substring:

where substr(phone1,2,10))=phone2

Not sure why this worked. Any suggestions on the best way to cast either one of the variables?


Thanks,

Bruce



     
  <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: 27 Dec 2016