Entering / Storing dates as dd.mm.yyyy

  • Thread starter Thread starter Duncs
  • Start date Start date
D

Duncs

I need to display / store my dates in the format dd.mm.yyyy, but I
can't get the formatting to work. I've tried setting the format in
the table, but it wont work. I've tried it on the fomr, but this wont
work. How do I do it?

Rgds

Duncs
 
If you are working with MS Access, the relational database, what gets stored
is NOT what gets displayed when dealing with dates.

Formatting is available via the table/field definitions, via the form's
controls, and by using the Format() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
I was trying to store the dates as dd.mm.yyyy in the table, but I've
just formatted them on the form.

Thanks for your help.

Duncs
 
I was trying to store the dates as dd.mm.yyyy in the table, but I've
just formatted them on the form.

Don't confuse data STORAGE with data PRESENTATION. They are different tasks!

A Date/Time field is stored without any formatting. It's not a text string;
it's a number, a count of days and fractions of a day since midnight, December
30, 1899:

?now; cdbl(now)
10/1/2009 3:40:13 PM 40087.6529282407

So - unless you are storing the date in a Text field, which would be a
terrible idea - what you're trying to do simply is impossible.

However, you can set the Format property of a Date/Time field to dd.mm.yyyy,
in the field's Table properties, in a Query's field properties, or (most
usefully) in the Format property of a textbox on a form or report. What's
*stored* in your table might be 40087.6529282407 or 40087.000000000; what the
user *sees* would be 01.10.2009.
 
Don't confuse data STORAGE with data PRESENTATION. They are different tasks!

A Date/Time field is stored without any formatting. It's not a text string;
it's a number, a count of days and fractions of a day since midnight, December
30, 1899:

?now; cdbl(now)
10/1/2009 3:40:13 PM  40087.6529282407

So - unless you are storing the date in a Text field, which would be a
terrible idea - what you're trying to do simply is impossible.

However, you can set the Format property of a Date/Time field to dd.mm.yyyy,
in the field's Table properties, in a Query's field properties, or (most
usefully) in the Format property of a textbox on a form or report. What's
*stored* in your table might be 40087.6529282407 or 40087.000000000; whatthe
user *sees* would be 01.10.2009.

Cheers guys. All I wanted to do was display the data on the form,
with the '.' date separator. I've now managed to do this.

Many thanks for your comments & help.

Duncs
 
I went back and re-read your original post. I think I got distracted with
the mention of "storing" and "table" and missed that you were trying to do
this in a form. Glad you found a solution!

Regards

Jeff Boyce
Microsoft Access MVP
 
Back
Top