Connecting Tech Pros Worldwide Forums | Help | Site Map

cast to integer?

jamesd0142's Avatar
Needs Regular Fix
 
Join Date: Sep 2007
Location: Wales
Posts: 467
#1: Oct 19 '07
ok i have this:

Expand|Select|Wrap|Line Numbers
  1. insert into DataSet_Rows 
  2. select rtrim(col01), rtrim(col02) from tempout
  3.  
col02 is a varchar(50)
but i want it to be an integer how can i do this?

cheers james

Newbie
 
Join Date: Oct 2007
Posts: 3
#2: Oct 22 '07

re: cast to integer?


Quote:

Originally Posted by jamesd0142

ok i have this:

Expand|Select|Wrap|Line Numbers
  1. insert into DataSet_Rows 
  2. select rtrim(col01), rtrim(col02) from tempout
  3.  
col02 is a varchar(50)
but i want it to be an integer how can i do this?

cheers james


insert into DataSet_Rows
select cats(col01 as int), cast(col02 as int) from tempout
Newbie
 
Join Date: Oct 2007
Posts: 3
#3: Oct 22 '07

re: cast to integer?


Quote:

Originally Posted by dusana

insert into DataSet_Rows
select cast(col01 as int), cast(col02 as int) from tempout


use this
insert into DataSet_Rows
select cast(col01 as int), cast(col02 as int) from tempout
Reply