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  

Help with Date and Time Query



 
 
Thread Tools Display Modes
  #1  
Old January 22nd, 2006, 05:24 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default 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  
Old January 22nd, 2006, 06:19 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default 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  
Old January 22nd, 2006, 06:19 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default 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

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

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


All times are GMT +1. The time now is 08:26 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.