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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|