Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Addind flexability to the database

Status
Not open for further replies.
Oct 6, 2002
60
US
Hello Experts,

I have a problem that I can't seem to solve. I have a query that projects the time of day at which approx. 100 events will occur (one record per event). basically I need to break up the day into 6 windows (4 hrs each) and assign a window number to that record/event thus allowing me to qurery on that field (window) and bring up all events that will occur in, say window = 1. The wrench in the whole thing is that the windows may have to change size dependant on the users needs, for example: I may have to change it to 2 - 12 hr windows. In an attenpt to build in that flexability, I have made a table that defines the windows - 6 records looks like the following: which I intend for the user to be able to update and thus change what window is assigned to each record. My question is how can I make the query look at the values in this table to assign a window to each record? Any help or alternative solutions would be appreciated.

Window StartTime EndTime
1 12:00am 4:00am
2 4:01am 8:00am
etc.

Thanks,
Ryan
 
A record will have a time. You want to join to this table to retrieve the Window number. You join from the time to a start time less than/equal to your record and an end time less then/equal to your record. There should only be one row that satisfies that join.

 
Thanks Mike.....I guess I took one too many stupid pills I just could not put it together. apperciate the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top