Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Curious query behavior
Message
De
16/02/2001 13:21:05
John Deupree
Long Term Care Authority
Tulsa, Oklahoma, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Curious query behavior
Divers
Thread ID:
00476726
Message ID:
00476726
Vues:
50
I have 2 SQL queries on local tables. They essentially do the same thing, one for active customers, one for inactive. Both get their results from 2 preliminary queries and 2 local tables. They both have the following in the where clause (include customers in the county list or in the zip code table):

(AT(ALLTRIM(co_county) + ",",cCountyList)>0 OR ;
SUBSTR(in_zip,1,5) IN ;
(SELECT Zip FROM hcfa_zip))

My question is this: This works fine in the first query (active). It does not work in the second. If I take the condition on either side of the OR by itself, it works fine in both queries. The county list and zip tables are the same for each. The active query includes an additional condition after this that the inactive does not. Is there anything in the query itself or the preliminary queries (order, etc.) that could affect this? I have matched everything I can in the 2 queries, and have tried different things with the preliminary queries, but to no avail. I can modify the code to get the right result. I’m just curious why it works on one and not the other (what affects the results).

TIA

John
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform