Mask Question

P

paduanow

Date Field

I need the data for the data field to be formatting like

yyyymmdd Example: 20090914

No dashes or slasher and I must have 8 digits. So I need 0 to fill.

Do I use a date field or text
 
B

Beetle

Use a field with a Date/Time data type, and whenever necessary
format it with;

Format([YourDateField], "yyyymmdd")

BTW - you don't specify what the name of the field is, but just as a point
of information, don't name it Date. That is a reserved word in Access.
 
R

Rob Parker

Use a Date/Time datatype in the table where the data is stored, and set the
format for the textbox displaying the date in either your form or report to
"yyyymmdd". You will be able to enter the date in any valid format; after
entry, it will display in the desired format.

HTH,

Rob
 
A

Arvin Meyer [MVP]

If you ever want to calculate values from the date, it is far easier to use
a date/time field. Formatting the display is trivial:

Format([My Date Field], "yyyymmdd")

If you use text, you'll need to reformat it and convert it to a date to do
any calculations on it.
 

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