Help with time formatting.Please!

D

Dupatt

Is there a way to set a time field default (in table) to Now() and have it
round to the nearest hour?
 
J

John W. Vinson

Is there a way to set a time field default (in table) to Now() and have it
round to the nearest hour?

No, because those are incompatible tasks! Now() returns the time to the
nearest second (actually a few microseconds), regardless of the formatting.

Try setting the default (in the form, you can't use custom functions in a
table) to

=CDate(Format(Now(), "mm/dd/yyyy hh:\0\0"))

John W. Vinson [MVP]
 
D

Dupatt

Thank you.
The problem with that is I don't want everything in the field that way; just
the ones appended from another table.
 
J

John W. Vinson

Thank you.
The problem with that is I don't want everything in the field that way; just
the ones appended from another table.

Use that expresssion as a calculated field in the Append query that copies the
records, then.

John W. Vinson [MVP]
 

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