Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Year function in date range not working
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01512452
Message ID:
01512453
Vues:
55
>I don't know why but I am getting dates (years) that are outside of the bounds of my SQL statement shown below. Why is the YEAR function not working? Neither statement below works within the date range I wanted.
>
>
>SELECT ;
>		 " " AS CheckOff, a.grpid, a.grpnum, b.lastname, b.firstname, b.dob, a.Hist, a.PlanKey, a.Status, a. Renewal, ;
>		a.ptd ;
>	FROM grpextcv  a ;
>	JOIN grpextin b ON a.grpid+a.grpnum=b.grpid+b.grpnum ;
>	WHERE a.Hist="99" AND ;
>		SUBSTR(DTOC(a.ptd), 7, 4) >= "1997" AND SUBSTR(DTOC(a.ptd), 7, 4) <= "2009" AND INLIST(a.Status, "A, B") ;
>		ORDER BY a.grpid, a.grpnum ;
>	INTO CURSOR tmpActiveBefore2009
>
>SELECT ;
>		 " " AS CheckOff, a.grpid, a.grpnum, b.lastname, b.firstname, b.dob, a.Hist, a.PlanKey, a.Status, a. Renewal, ;
>		a.ptd ;
>	FROM grpextcv  a ;
>	JOIN grpextin b ON a.grpid+a.grpnum=b.grpid+b.grpnum ;
>	WHERE a.Hist="99" AND ;
>		BETWEEN(YEAR(a.ptd), 1997, 2009) AND INLIST(a.Status, "A, B") ;
>		ORDER BY a.grpid, a.grpnum ;
>	INTO CURSOR tmpActiveBefore2009
>
Could you post some example data?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform