Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Queries

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 05-29-2006, 07:23 PM
Novice
 
Join Date: Feb 2006
Posts: 11
ddog171
Default Time queries

I need to selet events from a table that happen during a certain time period. The only problem is how do you do this when the time period involved is over two days?

In my table I have start time and end time.

EX.

Start Time/End Time
0630/0800
0800/0100
2300/0430
0400/0530
1200/1300
2200/2300


I want to select al the events that take place between 2200 and 0600. The following results should come back:

0800/0100
2300/0430
0400/0530
2200/2300

And help you can provide would be greatly appreciated.
Reply With Quote
  #2  
Old 06-04-2006, 07:51 AM
Novice
 
Join Date: Jun 2006
Location: USA
Posts: 6
mhartman
Default

Hello:

You need to figure in a date field some how and then calculate the difference between Now and the desired date. The following may help you:

The DateDiff function displays the variance in days between the values of the OrderDate and ShippedDate fields.
'
DateDiff("d", [OrderDate], [ShippedDate])
'
The DateAdd function displays a date that is 10 days before the value of the PromisedDate field.
'
DateAdd("y", -10, [PromisedDate])

Regards
Mark
Reply With Quote
  #3  
Old 06-04-2006, 04:45 PM
Novice
 
Join Date: Feb 2006
Posts: 11
ddog171
Default

I do have a date field, they are start day and end day.

Maybe I am missing your point but the query is not based off the date. I just need all the events over a certain period of time (ex. Between 2200 and 0600) regardless of the date.

Any additional explanation or help anyone can provide would be greatly appreciated.

Thank you
Reply With Quote
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Two Queries csolomon Queries 1 09-03-2009 11:33 AM
Crosstab Queries albst130 Queries 0 03-07-2007 06:32 AM
Queries the max from two rows mohsin74 Queries 0 12-14-2006 09:52 PM
VBA and stacked queries Pudy Queries 0 11-28-2006 12:58 PM
Running Queries from a form HaYuM Queries 0 06-13-2006 07:48 AM


All times are GMT -8. The time now is 08:27 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.