Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

leading zeros in a date/time field

Status
Not open for further replies.

wrbodine

Programmer
Aug 24, 2000
302
US
Hi,

Is there a way to have a date/time field that has leading zeros (i.e. 09/09/03 instead of 9/9/03)? Either after they enter it, or if there's some query we need to run....

Thanks,
Ray
 
That's a formatting issue and you can change your "Start / Settings / Control Panel / Regional Settings / Date" formats. Those will be used as the default date display format. Just change the short date format to "mm/dd/yy" instead of "m/d/yy".

If you are formatting things in code then use something like

Format ( MyDate , "mm/dd/yy" )

Note that dates are stored as numeric values independent of any particular format so there's nothing to change in the database.
 
as a 'field' object, the date-time data type is approximatly a double. it is only in hte 'formatting' that you have any resemblance to the conventional Date-Time representation.




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Thanx Golom!

We used your 2nd idea, creating text fields and using the Format function in code. This worked great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top