Welcome Guest, Not a member yet? Register   Sign In
previous month records
#2

[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.


Messages In This Thread
previous month records - by El Forum - 01-19-2008, 03:56 AM
previous month records - by El Forum - 01-19-2008, 04:44 AM
previous month records - by El Forum - 01-19-2008, 05:23 AM
previous month records - by El Forum - 01-19-2008, 06:02 AM
previous month records - by El Forum - 01-31-2008, 01:07 AM
previous month records - by El Forum - 02-04-2008, 07:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB