Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Syntax error in SQL SELECT
Message
 
 
À
03/10/2000 20:07:51
Jill Derickson
Software Specialties
Saipan, CNMI
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00424467
Message ID:
00424512
Vues:
12
>I have an SQL SELECT statement that executes FINE from the command window, yet give me a Syntax error when run from a .prg.
>
>dRptStart and dRptEnd are the beginning and end of a date rage, and have valid date values, since they are used in other places in the prg before this statement is selected (they also look ok in the debugger).
>
>
SELECT Defendants.defendantsID FROM CaseRelations, InCaseStatus, Defendants ;
>	INTO CURSOR cChargesFiled ;
>	WHERE InCaseStatus.StatusCode = 11 AND ;
>		INcaseStatus.IndefendantsID = CaseRelations.IndefendantsID AND ;
>		Defendants.DefendantsID = CaseRelations.DefendantsID AND ;
>		InCaseStatus.StatusDate <= dRptEnd AND ;
>		( EMPTY( Defendants.Closed ) OR BETWEEN( Defendants.Closed, dRptStart, dRptEnd ) )
>
>I can even put a breakpoint in the code just before this statement is to be executed, go to the command window and execute it, and it works...but in the code it fails w/a Syntax error.
>
>I'm missing something! but what? TIA for any input...J

Looks fine, but I would put into cursor (cChargesFiled) and the end of SQL statement and surround cChargesFiled with ().
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform