Hi all,
I currently have a working query that pulls all data from the previous month (not prev 30 days but the month). It feeds other queries which do some other functions and then those feed a graph to display some data. Now it is necessary for this graph to not only show data from the previous month, but to also have the options to show data from the past 3 months, 6 months, and 12 months. I know I could do this by creating different queries for each time frame, I don't want to do that however, more work than necessary IMO.
I have a combo with the options:
"Previous Month"
"Previous 3 months"
"Previous 6 months"
"Previous 12 months"
And then I would like to appropriately refresh the graph based on their selection. As I stated, my query is currently set up to grab only the previous month's data:
WHERE (((Year([EntryDate])*12+DatePart("m",[EntryDate]))=Year(Date())*12+DatePart("m",Date())-1))
How can I modify this to appropriately respond to the combo box selection (i.e user selects "Previous 6 months" and the graph refreshes with data from the prev 6 months)? It would be great if I only had to make changes to this one query as I have many others and this one is the baseline query that obtains the date ranges of data to feed the others.
Thanks for any help!
EDIT: I do not know- this may be an involved process, and my MSA skills have deteriorated due to not being used. If it would be easier I could create separate queries for each date range, then would it be possible to have the other queries select which 'date range query' to use based on the cbo? Just spitballing.