t_machine Posted April 17, 2008 Share Posted April 17, 2008 I have a sql query that already gets the current date using DATE(NOW()) but how can i get the current month instead? Any help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
ohioman Posted April 17, 2008 Share Posted April 17, 2008 Might you be looking for date("m") Quote Link to comment Share on other sites More sharing options...
t_machine Posted April 17, 2008 Author Share Posted April 17, 2008 Thanks for the reply.. I actually want to display results that are within the current month example Select * FROM table_name WHERE date="THIS MONTH"... What can I replace THIS MONTH with to get the results for the current month Thanks for any replies Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 17, 2008 Share Posted April 17, 2008 Just use the mysql MONTH() function. It is on the same page in the mysql manual where you found the NOW() and DATE() functions. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.