Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Val() in MySQL ?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01528303
Message ID:
01528454
Vues:
39
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform