A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Now()+1



 
 
Thread Tools Display Modes
  #1  
Old March 2nd, 2010, 07:00 PM posted to microsoft.public.access.queries
Caburky via AccessMonster.com
external usenet poster
 
Posts: 5
Default Now()+1

Using Access 2003:
A date/time field in my query has the criteria: #3/2/2010 7:00:00 PM# Or
#3/2/2010 7:00:00 AM#. I would this query to run each morning and tried to
replace the criteria with Now()+1 rather than entering a date each time, but
I do not get any data returned. I get a message "Access not responding". Am
I asking the impossible?

Thanks!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201003/1

  #2  
Old March 2nd, 2010, 07:36 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Now()+1

Caburky via AccessMonster.com wrote:

Using Access 2003:
A date/time field in my query has the criteria: #3/2/2010 7:00:00 PM# Or
#3/2/2010 7:00:00 AM#. I would this query to run each morning and tried to
replace the criteria with Now()+1 rather than entering a date each time, but
I do not get any data returned. I get a message "Access not responding".


Can't help with the not responding part (probably your db is
corrupted in some way).

For your query, Now()+1 is the time you run the query but
with tomorrow's date so I don't see how that can be useful.

If you want the criteria to be for today's date and either
7am or 7pm, try using something more like:
Date() + #7:00# OR Date() + #19:00#

--
Marsh
MVP [MS Access]
  #3  
Old March 2nd, 2010, 07:52 PM posted to microsoft.public.access.queries
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Now()+1

Does your criteria say Or or Between ..... And..... ? With the Or it
would only return records that have 7 am or 7 pm for that date.

Now()+1 would only return records with the exact time, down to the second,
for then next day. However even that shouldn't cause a not responding. Let's
see if your Now() function is working.

Do a Ctrl + g to bring up the VBA window.

In the Immediate window towards the bottom, put in the following then hit
enter:

Debug.Print Now()

That should give you the current date and time in the computer. If should
only take a milisecond to work. If you get an error, there may be a
references problem.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Caburky via AccessMonster.com" wrote:

Using Access 2003:
A date/time field in my query has the criteria: #3/2/2010 7:00:00 PM# Or
#3/2/2010 7:00:00 AM#. I would this query to run each morning and tried to
replace the criteria with Now()+1 rather than entering a date each time, but
I do not get any data returned. I get a message "Access not responding". Am
I asking the impossible?

Thanks!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201003/1

.

  #4  
Old March 2nd, 2010, 08:04 PM posted to microsoft.public.access.queries
Caburky via AccessMonster.com
external usenet poster
 
Posts: 5
Default Now()+1

Marshall Barton wrote:
Using Access 2003:
A date/time field in my query has the criteria: #3/2/2010 7:00:00 PM# Or
#3/2/2010 7:00:00 AM#. I would this query to run each morning and tried to
replace the criteria with Now()+1 rather than entering a date each time, but
I do not get any data returned. I get a message "Access not responding".


Can't help with the not responding part (probably your db is
corrupted in some way).

For your query, Now()+1 is the time you run the query but
with tomorrow's date so I don't see how that can be useful.

If you want the criteria to be for today's date and either
7am or 7pm, try using something more like:
Date() + #7:00# OR Date() + #19:00#


Marshall,
Thank you very much this worked perfectly. I didn't realize Now() was
embedding the time I was running the query.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201003/1

  #5  
Old March 2nd, 2010, 08:48 PM posted to microsoft.public.access.queries
Caburky via AccessMonster.com
external usenet poster
 
Posts: 5
Default Now()+1

Jerry Whittle wrote:
Does your criteria say Or or Between ..... And..... ? With the Or it
would only return records that have 7 am or 7 pm for that date.

Now()+1 would only return records with the exact time, down to the second,
for then next day. However even that shouldn't cause a not responding. Let's
see if your Now() function is working.

Do a Ctrl + g to bring up the VBA window.

In the Immediate window towards the bottom, put in the following then hit
enter:

Debug.Print Now()

That should give you the current date and time in the computer. If should
only take a milisecond to work. If you get an error, there may be a
references problem.
Using Access 2003:
A date/time field in my query has the criteria: #3/2/2010 7:00:00 PM# Or

[quoted text clipped - 4 lines]

Thanks!


Jerry,
Thanks for the feedback.

I took your advice and I did have an error. My first line of defense...I
rebooted and checked current date/time and I was back in business.

I used (Date()+1)+#7:00:00 AM# Or (Date()+1)+#7:00:00 PM# and that solved my
problem.

I appreciate your response, and I will remember the error checking technique
you passed along.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201003/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:29 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.