Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 20 Jul 2007 @ 13:44:43 GMT


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


Subj:   Re: Eternally Foolproof Casting from text to number
 
From:   Victor Sokovin

  I used the IN list rather than an ANSI/ASCII range just because I had it in my head to not presume anything about character encodings.  


If you don't mind assuming a certain character ordering (collation) then you might try the following idea:

     select *
     from (
     select 'A7' COL
     from sys_calendar.calendar
     union
     select '77' COL
     from sys_calendar.calendar
     union
     select '#7' COL
     from sys_calendar.calendar
     union
     select '.7' COL
     from sys_calendar.calendar
     union
     select '%?' COL
     from sys_calendar.calendar
     ) DT
     where DT.COL >= '00'
     and DT.COL <= '99';

Regards,

Victor



     
  <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