0

I have a dataset which currently the Event Time (trovalue) is in a CHARACTER format. I need to be able to convert these to an INTERGER so i can SUM these on import so i am able to GROUP the data.

Currently i have tried to do the following which is returning an error of invalid number string (7498):

CAST (TemplateRunObject_0.TroValue AS INT)

I am working from a Progress OpenEdge ODBC and pulling directly into Excel.

What is the best way to convert CHARACTER to INTERGER

Tom Bascom
  • 13,405
  • 2
  • 27
  • 33
Jack Williams
  • 141
  • 1
  • 1
  • 15
  • 3
    Perhaps you have a value which is not a number, that's why it gives you error. – Antonio Veneroso Contreras Mar 14 '19 at 14:45
  • You could use a `CASE` statement together with the `ISNUMERIC()` function to only perform the aforementioned `SUM` action only when the value is a number. – Tim Stack Mar 14 '19 at 14:53
  • It sounds pretty clear to me that you have data in that `TroValue` field that can't be cast to an integer. – JNevill Mar 14 '19 at 17:43
  • I would hazard a guess that the time is stored as "18:53:21" or something of that ilk. So the : is throwing off the CAST(). But without a data example we're all just guessing. – jdpjamesp Mar 15 '19 at 09:24

0 Answers0