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
|
|||
|
|||
Help with Date and Time Query
I hope someone can help me with this;
I am using Access 2003 and I have a date and time field. I would like to have a query that I enter the date into and it retrieves the records for that date from 11:00 am until 06:00 am the following day. I tried [Enter Date:] or [Enter Date:]+1 under the date criteria, and using AND = 11:00:00 OR = 06:00:00 undr the time criteria, but I get the error that the expression is too complicated or something like that.... Any help woul dbe appreciated. Thanks |
#2
|
|||
|
|||
Help with Date and Time Query
On Sat, 21 Jan 2006 21:24:01 -0800, REA
wrote: I hope someone can help me with this; I am using Access 2003 and I have a date and time field. I would like to have a query that I enter the date into and it retrieves the records for that date from 11:00 am until 06:00 am the following day. I tried [Enter Date:] or [Enter Date:]+1 under the date criteria, and using AND = 11:00:00 OR = 06:00:00 undr the time criteria, but I get the error that the expression is too complicated or something like that.... Any help woul dbe appreciated. Thanks A Date/Time value is actually stored as a Number: a count of days and fractions of a day since midnight, December 30, 1899. You might want to use = DateAdd("h", 11, DateValue([Enter date:])) AND = DateAdd("h", 30, DateValue([Enter date:])) DateValue will trim off the fractional portion (time) of the date entered (just in case the user types "1/23/06 10:00am" for some reason). DateAdd will give you the two times you specified - on that date and the next date (since you're adding over 24 hours). John W. Vinson[MVP] |
#3
|
|||
|
|||
Help with Date and Time Query
Try a criteria of:
Between [Enter a Date]+#11:00:00# AND [Enter a Date] + 1.25 -- Duane Hookom MS Access MVP -- "REA" wrote in message ... I hope someone can help me with this; I am using Access 2003 and I have a date and time field. I would like to have a query that I enter the date into and it retrieves the records for that date from 11:00 am until 06:00 am the following day. I tried [Enter Date:] or [Enter Date:]+1 under the date criteria, and using AND = 11:00:00 OR = 06:00:00 undr the time criteria, but I get the error that the expression is too complicated or something like that.... Any help woul dbe appreciated. Thanks |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cross tab query construction with Subqueries | Steven Cheng | Running & Setting Up Queries | 7 | February 13th, 2006 06:52 PM |
Toolbars, Drop-Down Menus | Rick | New Users | 1 | September 21st, 2005 11:17 AM |
Query for 'confirmation' | rogge | Running & Setting Up Queries | 8 | April 19th, 2005 03:26 PM |
Calendar Question | Josh | General Discussion | 7 | March 28th, 2005 11:19 PM |
Aggregating Date Data into Weeks and Quarters | Roger | Running & Setting Up Queries | 3 | July 11th, 2004 05:56 PM |