Or Day(DateSerial(Year(Date()), Month(Date()) + 1, 0), "d") or DatePart("d",
DateSerial(Year(Date()), Month(Date()) + 1, 0))
I prefer either of these to using Format, since Format returns a string, and
there requires coercion back to an integer, where as the Day and DatePart
functions return a number.
Or Day(DateSerial(Year(Date()), Month(Date()) + 1, 0), "d") or
DatePart("d", DateSerial(Year(Date()), Month(Date()) + 1, 0))
I prefer either of these to using Format, since Format returns a
string, and there requires coercion back to an integer, where as the
Day and DatePart functions return a number.
Good point and one which I had considered until I saw that the OP specified
that he wants the value to go into a "text field". In most cases though you
are correct that a numeric value would be the most likely result desired.
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.