Hi,
What is the format of your field "lastdatetime"? Obviously, if your field includes a date, then checking for >= 10:00am will not work, will it? Perhaps the best thing is to go into debug mode, and as soon as the line executes, place your cursor over the [lastdatetime] to see the actual format being returned to the code.
HTH, Randy