Automatic month to number

G

Guest

I have a field with numbers 0 - 163. 0 is this month (July). If i were to run
this report in 1 months time 0 would equal August. I would like another field
in my report that shows the month.

Is there a way of access automatically putting a month for me?
 
R

Rick B

Are you saying you want to add the number indicated to the current month?

So, if the field is a one, take the current month and add one to it?

If so, use the DATEADD feature.
 
J

Joseph Meehan

Pedro said:
I have a field with numbers 0 - 163. 0 is this month (July). If i were
to run this report in 1 months time 0 would equal August. I would
like another field in my report that shows the month.

Is there a way of access automatically putting a month for me?

Could you explain that again. I have no idea what you want to do. More
detail or some examples may help.

BTW you would not normally store the result of a calculation, especially
one that may change. It sounds like the result you want to store will
change each month. In that case you want to recompute it not store it.
 
J

James A. Fortune

Pedro said:
I have a field with numbers 0 - 163. 0 is this month (July). If i were to run
this report in 1 months time 0 would equal August. I would like another field
in my report that shows the month.

Is there a way of access automatically putting a month for me?

I'm not sure exactly what you are looking for, but I tried:

tblMonthsForReport
ID Autonumber
MonthNumber Long

1 0
2 1
....

qryDatesForReport:
SELECT Format(DateAdd('m', (SELECT A.MonthNumber FROM tblMonthsForReport
AS A WHERE A.ID = tblMonthsForReport.ID), Date()), 'm/yy') AS
DatesForReport FROM tblMonthsForReport;

which gave me:

DatesForReport
7/05
8/05
....

James A. Fortune
 

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