I need specific date AND time help - please help!

D

DTNHRD

I need my query to remove all records from view (not show) with a specific
deadline date at 8:01 am in the morning on that particular date EACH day. So
it would still show the records with that deadline date if someone ran the
query at 6:30 am or 7:59 am, but they would be GONE at 8:00 am. These are
posted jobs that people can apply for right up to 8:00am, after that - closed
to applications. There are different deadline dates on many of them, but the
deadline time is 8:00 am - we run 24 hours so employees are there at all
hours placing applications for internal jobs.

I'm obviously missing something in the order of the fields or the format of
the fields or the combinations of expressions I have used. The system
continues to remove the records at midnight when the date rolls instead of at
8:00 am.

I have tried adding or changing fields, different expressions telling the
query to sort for everything >8:00 for Date() and a number of other
expressions working with just the date field. I MUST be missing something so
obvious but I'm getting a big block now - I can't see the forest for the
trees.

The field in the underlying table has a deadline date and time of 8:00 am
and the format in the underlying table is general date with the input format
set to long date/time 00/00/00 00:00,LL;0; I also put in a TIME field to
try and run off but I'm not seeing what I need to do. Thank you graciously
for any input.
 
J

John Spencer

IF your record datetime field has the cutoff date and time then use

SELECT Stuff.*
FROM STUFF
WHERE Stuff.DateAndTime > DateAdd('h",8,Date())

OR
If your record datetime field only has the cutoff date then use

SELECT Stuff.*
FROM STUFF
WHERE Stuff.DateAndTime > DateAdd('h",-8,Date())



--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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