Hi everyone,
I'm trying to build a simple script that does the following. It
should find today's month and year, and then go into a DB query string
and look for all records that are from this month and the next three
months.
I've been playing around with the date() function for a while now, and
from that I can pull today's month and year, but I'm having problems
with the transition from December to January. For instance, when i
use the date function to get the current month, which for example say
is December, when i try to get the third month after that, my current
function adds 3 to the current month (which is 12), and gets 15. I'm
not sure what quite to do to make a simple function that will wrap
back around to January (which would be 1). Additionally, at the end
of the year, the year function has to change as well. So, three
months after December 2004 is March 2005, so the calculation needs to
recognize that because my month has gone over 12, I need to add 1 to
my year.
Anyone face something similar to this?
Best,
tencip
I'm trying to build a simple script that does the following. It
should find today's month and year, and then go into a DB query string
and look for all records that are from this month and the next three
months.
I've been playing around with the date() function for a while now, and
from that I can pull today's month and year, but I'm having problems
with the transition from December to January. For instance, when i
use the date function to get the current month, which for example say
is December, when i try to get the third month after that, my current
function adds 3 to the current month (which is 12), and gets 15. I'm
not sure what quite to do to make a simple function that will wrap
back around to January (which would be 1). Additionally, at the end
of the year, the year function has to change as well. So, three
months after December 2004 is March 2005, so the calculation needs to
recognize that because my month has gone over 12, I need to add 1 to
my year.
Anyone face something similar to this?
Best,
tencip
Comment