Search code examples
sqlintsybasetype-conversionvarchar

How to convert varchar to Integer sybase?


I can't cast or convert my varchar data , for example I have a varchar 145.345 and I want to convert it to Int , how can I do it? I can't do it directly because that number is taken from a gps so the format is not number.


Solution

  • My solution was: from that number (for example 123.456) I extracted 123 as varchar, then I extracted 456 as an another varchar. After that, I concatenated those 2 varchars and finally converted it into an Int (or any other format, as desired).

    Thanks for your help, guys.