View Single Post
Old November 30th, 2007, 07:57 PM
scottiegirl scottiegirl is offline
Authorized User
Join Date: Aug 2003
Location: Schuylerville, NY, USA.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts

Sorry, Mike. I desperately needed some food, so I went out to dinner. I'm back in the office and will be here for another 2 hours or so.

I tried substituting DATA_SUB and it still doesn't work. I had:
$result2 = mysql_query("SELECT id, first_name, last_name, company, date_format( entry_date, '%Y' ) AS formatted_year, date_format( entry_date, '%m' ) AS formatted_month FROM membership WHERE YEAR( entry_date ) = YEAR( curdate( ) ) ORDER BY MONTH( entry_date ) , last_name");
which gave me actual output and substituted your query:
$result2 = mysql_query("SELECT id, first_name, last_name, company, date_format(entry_date, '%Y') as formatted_year, date_format(entry_date, '%M') as formatted_month FROM membership WHERE entry_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 1 MONTH) AND DATE_SUB(CURDATE(), INTERVAL 3 MONTH) ORDER BY entry_date, last_name");
so that the interval-thing would work, but it's still not cooperating. I checked my MySQL database, and it's reading version 4.0.something. The only thing I'm questioning at this point is if DATA_SUB will work in that version.


aka Scottiegirl

"I was put on Earth to accomplish a certain number of things. Right now I am so far behind, I will never die." - Calvin, Calvin and Hobbs