Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Val() in MySQL ?
Message
From
08/11/2011 19:20:16
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01528303
Message ID:
01528454
Views:
41
>>I promiss I'll try it. Do you have a sample ?
>>
>>-gl
>
>select cast(charfild as int) as ConvertCharToint from myTable
>
>assuming that CharField only has valid entries that can be converted.

In MySQL you cannot cast to int, it will cause an error. You need to use Decimal instead:

Select CAST(charfield AS Decimal(10,0)) AS ConvertChar from MyTable.

It's a limitation in MySQL that has casted me many headaches before.
Christian Isberner
Software Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform