Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why doesn't this work?
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Why doesn't this work?
Miscellaneous
Thread ID:
00259423
Message ID:
00259423
Views:
45
I have a field in a table with values like "T1110X" and "T1110.12". I want to extract just the number part, which always starts on space 2. So I do ?TRAN(VAL(SUBS(myField,2))). For each field it works great showing: "1110" and "1110.12" respectively. Here's the weird part: If I use a SELECT statement: SELECT TRAN(VAL(SUBS(myField,2))) FROM myTable WHERE !empty(myField) -- for the same records I get "11" and "11". Why wouldn't this work? As a work around I am doing: SELECT LEFT(TRAN(VAL(SUBS(myField,2))),15)..... and it works fine. Can anyone teach me something here? I figure I wasted so much time on this, I should at least learn something out of it!

TIA,
Marcus.
Next
Reply
Map
View

Click here to load this message in the networking platform