SQL question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux