Need Some Date Help

S

Steveo

I have the following for a date which works fine in the form

Mid(Trim(Str([Date])), 5, 2) + Mid(Trim(Str([Date])), 7, 2) +
Mid(Trim(Str([Date])), 1, 4)

That shows: 06242007

I would like to get the date to display: 062407

Is this possible to do?
 
R

Rick Brandt

Steveo said:
I have the following for a date which works fine in the form

Mid(Trim(Str([Date])), 5, 2) + Mid(Trim(Str([Date])), 7, 2) +
Mid(Trim(Str([Date])), 1, 4)

That shows: 06242007

I would like to get the date to display: 062407

Is this possible to do?

You're working too hard...

Format([Date], "mmddyy")

NOTE: "Date" is a reserved word in Access (the name of a function). While
putting square brackets around the name will usually allow you to use a reserved
word as a field name it is best to avoid that because eventually it will cause
you a problem. Just use RecordDate or similar.
 
M

missinglinq via AccessMonster.com

Rick's right! Date() is an Access function, and both it and Time() can be
very dangerous functions, in that if you forget the brackets and code a line
like this:

Date = "12/31/2007"

"12/31/2007" isn't assigned to the control Date, but rather the system date
on your PC has been changed to New YEar's Day! Time() will do the same thing!
 
Top