|
Posted by Skybuck Flying on 01/06/08 09:59
Delphi snippet:
DecodeDate( Now, vNowYear, vNowMonth, vNowDay );
vMinimumAge := 5;
vMaximumAge := 29;
vMinimumBirthDate := FormatDateTime('mm"/"dd"/"yyyy', EncodeDate(
vNowYear - (vMaximumAge+1), vNowMonth, vNowDay ) );
vMaximumBirthDate := FormatDateTime('mm"/"dd"/"yyyy', EncodeDate(
vNowYear - (vMinimumAge+1), vNowMonth, vNowDay ) );
SQL snippit:
AND
(
(BirthDate <> null) AND
(BirthDate > #01/01/1970#) AND
(BirthDate < #20/20/1980#)
);
Notes:
Surround date strings as follows for ms access date comparisions:
#date string#
Bye,
Skybuck.
Navigation:
[Reply to this message]
|