Casting from character to numeric  
Author Message
cookieCutter





PostPosted: Visual FoxPro General, Casting from character to numeric Top

Any idea how to cast a characeter field to a numeric field.

I have a table w/ 150 'character' numbers that i need to be 'numeric' numbers

Thanks,
Mike



Visual FoxPro1  
 
 
dni





PostPosted: Visual FoxPro General, Casting from character to numeric Top

Numbers are integer only

 
 
CetinBasoz





PostPosted: Visual FoxPro General, Casting from character to numeric Top

numval = val(myField)

If you want to do at table level then you could use alter table along with one of the numeric types. ie:

alter table myTable alter myColumn i

alter table myTable alter myColumn b(2)

alter table myTable alter myColumn y

etc.