From: DTNHRD on
Our contract requires me to post a job for 10 calendar days and it must
remain active until 8:00 am the date of the deadline. After that it must be
removed from the list. If I post it today (3/15/10 regardless of the time)
the job would have to be available right up through 3/25/10 at 7:59am - then
it must be gone/unavailble at 8:00 am. The record has a field entitled
"Deadline" where date and time would be entered into the field as "03/25/10
08:00:00 am"

However, all records with that deadline for that particular date are removed
at midnight (00:00:00) on that date - I still need to show those records
until 8am. What do I need to do differently - change my field format, the
input/data or change the criteria in the query? I have entered my query
critera used in that "deadline" field below. Thank you in advance for your
consideration.

>=DateAdd("h",8,Date())

From: ghetto_banjo on

Try changing your criteria to use the Now() function instead of the
Date() function.


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


From: ghetto_banjo on
is this something that is always refreshing/updating? Or are you
calling the updates at a certain time?

seems like you could just do this:

criteria: >=Now()


then at 3/25/10 08:00:01 AM, any records with deadline of 3/25/10
08:00:00 would not show up.

From: Jerry Whittle on
<=DateAdd("h",8,Date())

Your criteria looks for records 8 hours into the future. I would think that
it should delete all future records. You actually want older records.

Also what runs at midnight to cause this to happen? You might want to show
us the code.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"DTNHRD" wrote:

> Our contract requires me to post a job for 10 calendar days and it must
> remain active until 8:00 am the date of the deadline. After that it must be
> removed from the list. If I post it today (3/15/10 regardless of the time)
> the job would have to be available right up through 3/25/10 at 7:59am - then
> it must be gone/unavailble at 8:00 am. The record has a field entitled
> "Deadline" where date and time would be entered into the field as "03/25/10
> 08:00:00 am"
>
> However, all records with that deadline for that particular date are removed
> at midnight (00:00:00) on that date - I still need to show those records
> until 8am. What do I need to do differently - change my field format, the
> input/data or change the criteria in the query? I have entered my query
> critera used in that "deadline" field below. Thank you in advance for your
> consideration.
>
> >=DateAdd("h",8,Date())
>
From: John W. Vinson on
On Mon, 15 Mar 2010 13:46:02 -0700, Jerry Whittle
<JerryWhittle(a)discussions.microsoft.com> wrote:

><=DateAdd("h",8,Date())
>
>Your criteria looks for records 8 hours into the future. I would think that
>it should delete all future records. You actually want older records.

Jerry? That's <= (Less Than or Equal); as written it would choose all records
older than 8am on the morning that the query is run (back to January 1,
100AD). Date() returns midnight at the beginning or today's date... right?

--

John W. Vinson [MVP]
 |  Next  |  Last
Pages: 1 2 3
Prev: "is not a valid name. Make sure...
Next: Update Query