I have a DB that presents monthly data based on the last 13 months. I need queries to separate the data into months based on Month(Now()). I will show you what I need with one example but I will need it for 13 queries. I cannot use a totals query to group all the information by month...trust me my output must be different.
So, Example: Month(Now()) = 6 and Year(Now()) = 2016. I need to return data for:
June 2016 back to through June 2015.
I have tried subtracting months but that does now work, like for December 2015. Month = 6 Year = 2016 and if I do Month(Now())-7 I get nothing. I know there is data for Dec 2015.
Remember I will have to do this 12 times. The 13th is the current month...easy.
I would like to do this in queries but if VB would be better I could use it...but how is still the question.
Final result of all the queries would be data for:
June 2016
May 2016
April 2016
March 2016
Feb 2016
Jan 2016
Dec 2015
Nov 2015
Oct 2015
Sep 2015
Aug 2015
Jul 2015
June 2015
And when I run the queries in July I would get July 2016 back to July 2015.
Any ideas that might help me out.
Thank you in advance,
So, Example: Month(Now()) = 6 and Year(Now()) = 2016. I need to return data for:
June 2016 back to through June 2015.
I have tried subtracting months but that does now work, like for December 2015. Month = 6 Year = 2016 and if I do Month(Now())-7 I get nothing. I know there is data for Dec 2015.
Remember I will have to do this 12 times. The 13th is the current month...easy.
I would like to do this in queries but if VB would be better I could use it...but how is still the question.
Final result of all the queries would be data for:
June 2016
May 2016
April 2016
March 2016
Feb 2016
Jan 2016
Dec 2015
Nov 2015
Oct 2015
Sep 2015
Aug 2015
Jul 2015
June 2015
And when I run the queries in July I would get July 2016 back to July 2015.
Any ideas that might help me out.
Thank you in advance,