Link to home
Start Free TrialLog in
Avatar of szadroga
szadrogaFlag for United States of America

asked on

current month with rolling previous 6 months in mysql

I am trying to report numbers back rolled up by month for the past 6 months based off of the current_date() field.  I tried using date_add(month(current_date()),INTERVAL -6 MONTH) but that does not work.  

I did have date_add(current_date(),INTERVAL -6 MONTH) in place but that is not totally accurate because if i run the query in the second week of the month then the first month (october) will only have numbers for the remaining two weeks.  I need it by month.
ASKER CERTIFIED SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of szadroga

ASKER

the LAST_DAY() did the trick. thx!