Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cast or convert not working
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01216246
Message ID:
01216301
Vues:
17
>>I thought the following code would work, but it doesn't. Maybe one of you SQL gurus can help. I have a sql table which has a column for badge number (badgeno) it is of type char() 4 characters. I attempted to run a query from vfp like the following:
>>
>>select * from employees where cast(badgeno as numeric(10))>0
>>
>>I get an error message - Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type varchar to numeric
>>
>>Any ideas?
>
>Most likely you have none-numeric data. Run following query to find offending record(s)
>
>select * from employees where ISNUMERIC((badgeno) = 0
>
Yes, it's all non-numeric. I was looking for an isdigit() and it seems you have given it to me!

Thanks once again!
John Harvey
Shelbynet.com

"I'm addicted to placebos. I could quit, but it wouldn't matter." Stephen Wright
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform