Need Some Date Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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.
 
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!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 

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

Back
Top