Using MonthName function in 97

  • Thread starter Thread starter ThomasK
  • Start date Start date
T

ThomasK

Hi,
I just converted my database from Access 2003 to Access 97. Now when I try to
run my query, it comes back with an error, "undefined function 'MonthName' in
expression". I guess Access 97 does not use "MonthName" function. I need to
rewrite the expression in my query, but Im not sure how to replace the
MonthName function. This is my expression in my query:

Month of Last Contact: MonthName(DatePart("m",Last(Nz([DateSent],[InspDate])))
)

Can someone help me change this expression?

Thanks,

Thomas
 
Change it to:

Month of Last Contact: Format(DatePart("m",Last(Nz([DateSent],[InspDate]))),
"mmmm")

See the Format() function in the Help for details and be sure to study the
examples. Incidentally, beware: the result is a string, not a date!

HTH
Hi,
I just converted my database from Access 2003 to Access 97. Now when I try to
run my query, it comes back with an error, "undefined function 'MonthName' in
expression". I guess Access 97 does not use "MonthName" function. I need to
rewrite the expression in my query, but Im not sure how to replace the
MonthName function. This is my expression in my query:

Month of Last Contact: MonthName(DatePart("m",Last(Nz([DateSent],[InspDate])))
)

Can someone help me change this expression?

Thanks,

Thomas
 
Format(Last(NZ(DateSent,InspDate)),"mmmm")

You can use "mmm" to get the abbreviated month name.
 
John,
I used your code and it worked great, Thank you.

Thomas

John said:
Format(Last(NZ(DateSent,InspDate)),"mmmm")

You can use "mmm" to get the abbreviated month name.
Hi,
I just converted my database from Access 2003 to Access 97. Now when I try to
[quoted text clipped - 11 lines]
 

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