Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Birthdays this week
Message
 
 
À
19/03/2009 13:17:20
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01389309
Message ID:
01392084
Vues:
110
Invalid day parameter for DATE() function does not generate an error in a query but produces empty date. EVL() or IIF in VFP7 and earlier can be used to replace Feb. 29 with Feb. 28 in such case assuming that all DOBs are valid dates (not empty or null).
SELECT * ;
	FROM People ;
	WHERE ;
			EVL(DATE(YEAR(ldStartDate), MONTH(dob), DAY(dob)),  ;
				DATE(YEAR(ldStartDate ), MONTH(dob), DAY(dob-1))) ; 
					BETWEEN ldStartDate AND ldEndDate ;
		OR ;
			EVL(DATE(YEAR(ldEndDate), MONTH(dob), DAY(dob)),  ;
				DATE(YEAR(ldEndDate), MONTH(dob), DAY(dob-1))) ;
					BETWEEN ldStartDate AND ldEndDate
>The date() function in your example would fail fail if a person happened to be born on Feb. 29 - I believe that I'll have to convert those dates to Feb. 28, using an iif().
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform