Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL not working as expected
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01007835
Message ID:
01007839
Vues:
10
This message has been marked as the solution to the initial question of the thread.
Brenda,

A string comparison works differently in SQL commands and in the rest of FoxPro. See SET EXACT and SET ANSI for details. With both those settings OFF, "" <> "04" is true in the command window and false in the query. It's better to avoid ALLTRIM() function in the queries WHERE clause. I don't see why do you need ALLTRIM() and UPPER() in this case at all.
 Select * FROM property WHERE key = '00011987' and;
prop_type != '04'
>
>The following SQL returns an empty result set. The prop_type is two spaces. When I am in the command window, both of the SQL Where clauses return .T. when the property record pointer is on the 00011987 key. but when I run the SQL an empty result set is returned. Why?
>
>
 Select * FROM property WHERE key = '00011987' and;
>alltrim(upper(prop_type)) != '04'
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform