Controlling size of a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an table full of inputs and one of these inputs determines how many
months of data I wish to create. I am planning on using the query a little
bit like a spreadsheet for the mathematical properties. I was wondering if
there is anyway I this input (number of years) to create a query with the
coresponding number of months, and have them labeled.

For example, I would like to input 15 years and come up with months labeled
1 through 180.

I really like the ability in Access to create forms and reports, so I don't
really wish to go back to excel, but if I must well then I must.
 
I have an table full of inputs and one of these inputs determines how many
months of data I wish to create.

I do not understand this statement. Normally criteria in a query determines
the time span for the results.

In a Totals query you can use this as criteria for your date field --
DateAdd("yyyy",-[Enter # of years], Date())

Then insert a new column on the left like this --
Month number: DateDiff("m", DateAdd("yyyy",-[Enter # of years],
Date()),[YourDateField] )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top