Automatic month to number

P

Pedro

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

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
 
Top