Text field like Date field

M

Maracay

Hi Guys,

I have a textbox where I type a Date "July 02, 2009" the and saved this
value in a table in a text type field but is stores as 7/2/2009, I need this
value in the table as July 02, 2009, How can I do this.

Thanks
 
B

BruceM

Format as needed for display in a form or report. There is no need to
format the table, which is not meant as a user interface. The date is
stored as a number, so the format is irrelevant except for display.

You can use the following as the Format property of a text box on a form or
report:
mmmm dd", "yyyy
 
J

John W. Vinson

Hi Guys,

I have a textbox where I type a Date "July 02, 2009" the and saved this
value in a table in a text type field but is stores as 7/2/2009, I need this
value in the table as July 02, 2009, How can I do this.

Thanks

Don't confuse data STORAGE with data DISPLAY.

No matter how a date is formatted it's stored internally as a number, a count
of days and fractions of a day since midnight, December 30, 1899. Today (July
2) is 39996.0000000000. Entering "July 2, 2009" or "7/2" or "2 July" or any
other valid date format will store it as 39996.0000000000.

You can set the Format property of a textbox on a form or report, or even the
Format property of the table field, to "mmmm dd, yyyy" to *display* 39996 as
"July 02, 2009". That's the preferable way to do it, since the dates will sort
chronologically and can be searched easily. You could store the date in a Text
field but it would be much harder to search, and would sort in the order
"April", "August", "December"... alphabetically, not chronologically.
 
M

Maracay

Thanks, works perfect

BruceM said:
Format as needed for display in a form or report. There is no need to
format the table, which is not meant as a user interface. The date is
stored as a number, so the format is irrelevant except for display.

You can use the following as the Format property of a text box on a form or
report:
mmmm dd", "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