Custom Date Function MM/YYYY

N

nickelpar

Anyone have or can tell me how to write a module for a
custom date function to return a MM/YYYY format for a
short date (10/16/03 to 10/2003)?
 
A

Allen Browne

Internally, Access stores the date as a floating point number.

Just use the Format() function e.g.:
Format([SomeField], "mm/yyyy")
 
J

John Vinson

Anyone have or can tell me how to write a module for a
custom date function to return a MM/YYYY format for a
short date (10/16/03 to 10/2003)?

No module or function is needed. Simply set the Format property of a
textbox to

mm/yyyy

The Date value is stored internally as a Double Float count of days
and fractions of a day; the format is whatever you want it to be. If
you need a mm/yyyy text string in code you can just use the builtin
Format function:

strDate = Format([datefield], "mm/yyyy")
 

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