Date Formatting

B

Ben

I want to have the date be mm/yyyy. When i change the input mask for short
date, when i type 3/2008 it reverts back to 3/1/2008. How can I change this?

Ben
 
D

DM

I'm not sure if you can put this in a mask but here is what I use in queries
for filtering parameters like your 3/2008 or for printing it in reports like
this.

It never hurts for the date to be fully captured in the table. It allows for
more options and the format can always be manipulated in queries/reports.

=Format$([date field name between these brackets],"m yyyy",0,0)
 
J

John W. Vinson

I want to have the date be mm/yyyy. When i change the input mask for short
date, when i type 3/2008 it reverts back to 3/1/2008. How can I change this?

Ben

You can't.

A Date/Time field is actually stored as a double float count of days and
fractions of a day (times) since midnight, December 30, 1899. As such a
date/time must correspond to a precise moment of time. March 2008 has been a
whole bunch of moments, some pleasant, some irksome, some boring - but 03/2008
is not a valid time.

You can set the FORMAT of the textbox to mm/yyyy it will display March first,
or March 28th, as 03/2008 - but that's not what's stored, you're concealing
data (the day) and may run into problems searching the field.

If you really want to store only the month and year, consider using a Text
field or two Number/Integer fields.
 

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

Similar Threads


Top