SQL question

From: Date: Tue, 26 Jan 2010 03:54:40 +0000
Subject: SQL question
Groups: php.general 
Request: Send a blank email to php-general+get-301451@lists.php.net to get a copy of this message
Hey all, I have an SQL query that's stumping me. I have two date variables, $start and $end that are in mm/dd/yyyy format and two database fields, start_date and no_donations. The start date is mm/dd/yyyy format and no_donations is an integer that represents the number of months from start_date that donations will be made. So if start date is say 02/01/2010 and no_dations is 4 then donations will be made four times from the start date for four months. What I need to do is come up with a query that will determine if the start_date + no_donations falls within $start and $end. But I'm pretty stumped. How can I convert start_date + no_donations in the database to the date when the last donation will take place so I'll now if the donations fall between $start and $end? Any suggestions would be very help and appreciated, Skip -- ==================================== Skip Evans PenguinSites.com, LLC 503 S Baldwin St, #1 Madison WI 53703 608.250.2720 http://penguinsites.com ------------------------------------ Those of you who believe in telekinesis, raise my hand. -- Kurt Vonnegut

« previous php.general (#301451) next »