Date and time

G

Guest

I am trying to do a simple If then else statement. My table is collecting a
date and time stamp (all in one row-general date). I need to be able to sort
the time into two categories First Shift and Second shift based on time.
When I try to write the If statement >8/10/2005 5:00 am it sees it as too
much information. It wants me to stop at the date. What can I do about this?
 
D

David C. Holley

Secondary to that ALWAYS, ALWAYS, ALWAYS say please & thank you AND
encapsulate your date & time values in pound signs (#) as in #8/10/2005
5:00 AM#. The pound signs indicate to VBA that its dealing with a date.
Otherwise, it will try and divide 8 by 10 by 2005.
 

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