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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default Value Time Format

Status
Not open for further replies.

andy570

Technical User
Jan 5, 2004
40
US
Hi, here is what I am wanting to do: When someone enters a new report I want an entry in the date field. Currently I am using Now() in the default field for DATE. I have tried the following Format(Now(), "dddd, mmmm dd, yyyy h:nn:ss AM") however I get a type mismatch error when I enter this. What I would like to do is have the date entered into the field be formated as such: Monday, June 7, 2004 3:04:30 PM. Any help would be greatly appreciated. Thanks.
 
Date" isn't a good field name since it is also a function name.

It makes no difference how the format is set in the saving of the value. I would not use any format unless you were saving this to a TEXT field. Dates are dates are dates. You can set the format property in forms and reports so that it "displays" in a particular format.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
andy,

I may have misunderstood your initial question.

As Duane stated, "Dates are dates are dates." To elaborate on that, Dates are really just NUMBERS like TODAY is 38145 and that's how it's stored. TIME is a value LESS THAN ONE, like NOW is 38145.78562. It can be FORMATTED to DISPLAY any number of ways as you have described above.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top