Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Calander month using text not number!

Status
Not open for further replies.

Zeroanarchy

Technical User
Jun 11, 2001
630
AU
What I am trying to do is to display the numer of months till follow up, the problem I have is I need the Month in text for the table, and in the text box [Text227] I need the month in numeric.

hehe
Ok here is what I have done so far:

Text227: Control Source = =DateDiff("m",[expr2],[expr3])

Expr2: Control Source = =Month(Now()) & "/" & Year(Now())

Expr3: Control Source = =[Followupmonth]+"/"+[followupyear]

Followupmonth is a combo box with a list of the months in text eg. January, February, march and so on..

Folowupyear is much the same except it is the years eg. 2001, 2002, 2003 ....

Does anyone know:

A better way to do this without using a query wich enables me to keep a text version of the month in my table and a numeric version available for [Expr3]

Thanks..
 
Hi Zeroanarchy

Try changing
Expr2: Control Source = =Format(Date(),"MM/YYYY")
Expr3: Control Source = =Format([Followupmonth] & " 01, " & [followupyear],"mm/yyyy")

and use your original
Text227: Control Source = =DateDiff("m",[expr2],[expr3])


and that should do it.

*
***
*****
Ziggurat

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top