Months

S

Sarah

I have a advertising contract table that has the following columns (as well
as other - however these are the only important ones at this time):

Starting Month (in MMMM format ex: APRIL)
# of Months Running

I would like to run a make table query (or any query) which gives me the
months that each record is running, i.e. if the starting month is April and
it runs for 3 months I would like to create a record in the query for each
month it is running.

Is this possible?
 
S

Slej

Sarah,

If your date field is just a month, I'm not sure you can systematically have
a query do the math for you.

HOWEVER, if you can change your date field to mm-dd-yyyy or somthing
similar, than in a query you can do something like this:

column A: [starting month]
column B: Today: Date()
column C: Months Running: DateDiff("m",[starting month], [today])

In my example above: you would create a new field in the query called Today
and also a new field called Months Running. You wouldn't need to have # of
Months as a field in your original table.

After running the query, you could then create a Make Table query that would
give you a new table that WOULD include the months running as a field (you
would probably want to include all of your fields from the original table
except the # of months running field then create Columns B & C in the above
example, run the query, then change the query to a Make Table. )

Hope this helps you. Thanks.
 
D

Duane Hookom

I would add a field or change the existing month field to a number to store 4
rather than April. Either that or create a small table with your month name
and the appropriate number.

What would you do with October with 4 running months? How do you expect to
handle multiple years?
 

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

Top