Problem with ifthenelse statement on time function

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

Guest

Hi,

I've done some searching, and have yet to find the solution to my problem.

I have added a journal to my employees access so that each shift they can
write in notes and things for the next shift to read.

I'm trying to make it so that if it is less than noon on this day, then it
will print the jounral for date()-1 else it will print todays journal...

I'm tried as an experament to do this statement:

=IIF(time() < "11:30:00 AM", date()-1, date())

But this does not seem to read properly... if I simple have it write out the
time it says:

9:34:45 AM

Any help on this would be appreciated.. do I need to format the time before
I do a condition like this? just a little unsure.
 
Try this --
=IIF(Now() < Date()+.5, date()-1, date())

Now() has the date and time
Date()+.5 is the DateTime at 12 PM
 
Thanks a lot Karl, seems to work perfectly. Makes a lot more sense than what
I was trying to do. Really appreciate the help!
 

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