This will get records where the date is within 30 days of today: WHERE TO_DAYS(NOW()) - TO_DAYS(DATE_FIELD) <= 30
TO_DAYS is a function in MySql. There are a number of these type functions. Stanley G. Martin Sprint - ISS Enterprise App/Decision Support Services [EMAIL PROTECTED] -----Original Message----- From: kris [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 4:55 PM To: dbi-users Cc: Perl-Win32-Users Subject: date compare in sql ??? Hi folks, i hope you had an nice x-mas. Well, back in the office i have a lot things to do, that's more "administrative" stuff. I know i can compare dates in a mysql table, but i have problems to do a comand that's compares a date (added by days) whith now(). e.g: Select... ... WHERE (startdate + $days) < now() so how i can add $days to the database field startdays and check it with the now() time ? Thanx for any help Kris _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
