Run last 24 hours.

S

Stryder09

I would like to create a query that will only show me data entered on the
shift in the last 24 hours.

The employee's are entering the Date. time, and checks 4 times a shift. I
want to be able to see those 4 entries only and I thought maybe creating a
criteria like

Date() - [enter number of hours]

Would be able to do the job, I'm just not sure how to look 24 hours ago to
now.

I know its not that simple but what should I use as a criteria to be able to
see the last day of entries? I would like this to be on a report where the
supervisor will click a button and see the entries for their current shift.
Any help would be appreciated.
 
M

Michel Walsh

DateAdd("h", -2, date() )


add minus two hours to the today, midnigth, so you can use:


DateAdd("h", -[Number of hours before midnight], date)






Vanderghast, Access MVP.
 
A

AJOLSON

Try >=Now()-1 Using 5/5/2009 2:30pm for example you would get all records >=
5/3/2009 2:30pm

Everytime they would execute the query they would get all records for the
past 24 hours using the execute time as the ending point

Hope that helped
 
A

AJOLSON

ops I ment you get everything 5/4/2009 2:30pm and above. SOrry

AJOLSON said:
Try >=Now()-1 Using 5/5/2009 2:30pm for example you would get all records >=
=5/4/2009 Everytime they would execute the query they would get all records for the
past 24 hours using the execute time as the ending point

Hope that helped

Stryder09 said:
I would like to create a query that will only show me data entered on the
shift in the last 24 hours.

The employee's are entering the Date. time, and checks 4 times a shift. I
want to be able to see those 4 entries only and I thought maybe creating a
criteria like

Date() - [enter number of hours]

Would be able to do the job, I'm just not sure how to look 24 hours ago to
now.

I know its not that simple but what should I use as a criteria to be able to
see the last day of entries? I would like this to be on a report where the
supervisor will click a button and see the entries for their current shift.
Any help would be appreciated.
 
S

Stryder09

Thankyou it works perfectly.

AJOLSON said:
Try >=Now()-1 Using 5/5/2009 2:30pm for example you would get all records >=
5/3/2009 2:30pm

Everytime they would execute the query they would get all records for the
past 24 hours using the execute time as the ending point

Hope that helped

Stryder09 said:
I would like to create a query that will only show me data entered on the
shift in the last 24 hours.

The employee's are entering the Date. time, and checks 4 times a shift. I
want to be able to see those 4 entries only and I thought maybe creating a
criteria like

Date() - [enter number of hours]

Would be able to do the job, I'm just not sure how to look 24 hours ago to
now.

I know its not that simple but what should I use as a criteria to be able to
see the last day of entries? I would like this to be on a report where the
supervisor will click a button and see the entries for their current shift.
Any help would be appreciated.
 
M

Marshall Barton

Stryder09 said:
I would like to create a query that will only show me data entered on the
shift in the last 24 hours.

The employee's are entering the Date. time, and checks 4 times a shift. I
want to be able to see those 4 entries only and I thought maybe creating a
criteria like

Date() - [enter number of hours]

Would be able to do the job, I'm just not sure how to look 24 hours ago to
now.

I know its not that simple but what should I use as a criteria to be able to
see the last day of entries? I would like this to be on a report where the
supervisor will click a button and see the entries for their current shift.


You could use:

DateAdd("h", -[enter number of hours, Now())
 

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