previous month records |
[eluser]Sawariya[/eluser]
Hi friends.. how to retrieve previous month records from mysql database table... thanks in advance
[eluser]Michael Wales[/eluser]
Code: SELECT * FROM table WHERE MONTH(date_field) = MONTH(SUBDATE(CURDATE(), INTERVAL 1 MONTH)) I think that will work, just coming off the top of my head. Check out MySQL's date documentation.
[eluser]Sawariya[/eluser]
One more doubt .. how to get previous month name according to server date.. its not from databse,,,?? i think its possible ...
[eluser]Sawariya[/eluser]
Hi Michael Wales Thanks for your help.. This is working... but i its not checking year... |
Welcome Guest, Not a member yet? Register Sign In |