I have a field in a table that contains some entries as text and others as numeric entries. The field is defined as A30. What i am trying to do is extract the numeric entries, either by using a query or Tcursor.... Any suggestions.
Thanks in advance
je77
There are a couple of ways you can do this, depending on the results you're after and what you want to do with them.
One way would be to copy the structure of the initial table to a new one and then restructure the A30 field to a numeric one. Next, try to do an INSERT quert that adds the records from the first to the second.
When that process completes, you'll see a PROBLEMS table that shows the alpha-only values (or, more properly, the ones that could not be converted to numbers). (The second table now contains the data that converted properly.)
PROBLEMS is a temporary table, which means it'll disappear quickly (just like ANSWER). So, if you need to retain those troublesome values for any length of time, it's be a good idea to rename PROBLEMS as quickly as possible.
If you want more control over the process, you can also use TCursors and copyToArray() to convert the data. You can discover whether or not a value can be converted using something like this:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.