Date()

unclefink

Registered User.
Local time
Today, 14:08
Joined
May 7, 2012
Messages
184
I have a query that reports jobs occuring today, which is working awesome so far. I'd like to expand on my current data and also show any jobs that started yesterday that go beyond midnight which are still in effect and end today.

Currently I have all the data I want to show with criteria of Date() set for job date.

Any reccomendation/guidance would be greatly appreciated.
 
"Date() - 1" wthout the quotes is yesterday.
 
"Date() - 1" wthout the quotes is yesterday.

What I am looking for is all data associated to today and any data that started yesterday and continues past midnight.

For example if a job started tonight at 9pm and runs through tomorrow at 7am, it shows on the new date since it went past midnight.
 
So what do you have , a start date and an end date?

If so won't enddate = Date() give you what you want?.

Brian
 
So what do you have , a start date and an end date?

If so won't enddate = Date() give you what you want?.

Brian

And if there is no End Date then the job must still be open.
 
Just noticed the additional replies since I last checked. I noticed the reply from BrianWarnock as I was dozing off last night so I applied the Date() criteria to "enddate" today and it does exactly what I am looking for. Thank you gentlemen for the outside insite as I have no clue as to how I even overlooked this option as it makes total sense. I'm signing up for Access classes at the end of the month so hopefully after that, I will be able to be the person soon to be helping others.

Thanks again for the help, its greatly appreciated. Have a great rest of the day.
 
note you can use "between" also as your criteria


eg
between date() and date()-1
 
well often you aren't quite sure exactly what you want, and it is not obvious that there actually is the option of "between".

at some point the OP may well be interested in a range of dates.
 
Thank you everyone for the help, its much appreciated. I used the Date() in my start and end date and it gives the data I am looking for. I would however like to take this one step further and make any data whos end time has passed, it also goes away.

For example:

Start Time: 02/21/2013 06:30
End Time: 02/21/2013 15:00

Once the system clock hits 15:01 or 3:01 pm, that specific job goes away.

Reference the same database attached. There is a table, query, and form. I would ultimately be using the form to view data which updates itself currently every 5 seconds which will change once i figure this all out.

Thanks in advance.
 

Attachments

Users who are viewing this thread

Back
Top Bottom