changing a date based on the time of day

G

Guest

Hi all, I'm working on a database to track when mail comes into an office and
put a date stamp on it so we can track how much of each type of mail is
coming in and worked each day. I'm trying to create a function for this date
stamp where if the entry is put into the database after a certain time of day
(i.e. anytime after 4 pm) then the date applied will be for the following day
as opposed to today. Any help?
 
J

John W. Vinson

Hi all, I'm working on a database to track when mail comes into an office and
put a date stamp on it so we can track how much of each type of mail is
coming in and worked each day. I'm trying to create a function for this date
stamp where if the entry is put into the database after a certain time of day
(i.e. anytime after 4 pm) then the date applied will be for the following day
as opposed to today. Any help?

You could set the DefaultValue of the form control to

=DateValue(DateAdd("h", 8, Now()))

A more complex function will be needed if you want mail arriving Friday
afternoon at 4:30 to get stamped with the next Monday's date... but it's
certainly doable.

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