dbTalk Databases Forums  

Searching Range of Times

comp.databases.filemaker comp.databases.filemaker


Discuss Searching Range of Times in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Cylurian
 
Posts: n/a

Default Searching Range of Times - 08-09-2003 , 01:42 AM






First question is can a field hold a range of time? For example, I have
a tutor who works Monday 11 am - 2 pm and again 6 pm - 9 pm. Can I store
that in a field or should I use multiple fields.

Then how can I script FM so it will be able to identify that at 8:30 pm a
student can work with that tutor, for it falls in the tutor's hours.

thx

Reply With Quote
  #2  
Old   
John Weinshel
 
Posts: n/a

Default Re: Searching Range of Times - 08-09-2003 , 08:28 AM






There is not one answer to either of your questions, because those answers
depend on what you need to do with the information. Filemaker stores dates
as numbers-- the number of days since 1/1/0001, and time as the number of
seconds elapsed since midnight. Date/time values, then, can be expressed
numerically as seconds, by multiplying the days by the number of seconds in
a day (best to start from one constant, recent date, such as 1/1/1970 like
Unix, or 1/1/2000, to keep the values reasonably low), and then adding the
time component.

Typically, date/time events are broken into single components lasting as
long as the shortest event the project needs to track-- perhaps half-hour
blocks might work in your example. Then multiple child records-- one for
each unit-- are scripted to be created for each event, 6, say, for 6 p.m. to
9 p.m. Then multiline keys are calculated to test date/time ranges against
those blocks.

Much more complex and dynamic date/time range problems can be managed using
Smart Ranges:
http://www.onegasoft.com/tools/smartranges/index.shtml

....but the learning curve can be steep. It will allow you to test ranges on
both sides (is the tutor working any time between two date/time values),
without the need for a zillion child records.
--
John Weinshel
Datagrace
Vashon Island, WA
(206) 463-1634
Associate Member, Filemaker Solutions Alliance


"Cylurian" <fsromero (AT) hotmail (DOT) com> wrote

Quote:
First question is can a field hold a range of time? For example, I have
a tutor who works Monday 11 am - 2 pm and again 6 pm - 9 pm. Can I store
that in a field or should I use multiple fields.

Then how can I script FM so it will be able to identify that at 8:30 pm a
student can work with that tutor, for it falls in the tutor's hours.

thx



Reply With Quote
  #3  
Old   
Cylurian
 
Posts: n/a

Default Re: Searching Range of Times - 08-09-2003 , 02:12 PM



I just want FMP to check a range of times and say, the time you were
finding is in that range. I just don't know if a field may have a
range.

Reply With Quote
  #4  
Old   
John Weinshel
 
Posts: n/a

Default Re: Searching Range of Times - 08-09-2003 , 02:56 PM



First of all, you can almost always use regular searches to look for
date/time ranges. An ellipse placed between two valid values in a date or
time field indicates a range between those values (only in Find mode). So,
while, in that sense, a field cannot actually 'have a range', you can search
for one. This is probably the most common method of dealing with date/time
ranges.


12:32:03 on 8/09/03 converts, using my earlier decription, to a numerical
value of 82125123. One way Filemaker expresses ranges is with multiline
fields, text (or calculations returning text) lists in which each discrete
value is separated by a return:

82125123
82125124
82125125
82125126
82125127


....expresses a range of the 5 seconds from 12:32:03 to 12:32:07. Used as a
left hand relational key, its children would be any records containing any
one of its lines it a field that calculated the time/date numerical value.

Since you normally wouldn't want to look through a year by seconds, you
would want to use the largest unit possible to describe the components of a
range, and then build numerical representations of multiples of those units,
rather than of seconds (FMP's smallest time value). From there, you can
build relational keys that can describe ranges and display 'hits' in a
portal or via a GTRR.

--
John Weinshel
Datagrace
Vashon Island, WA
(206) 463-1634
Associate Member, Filemaker Solutions Alliance


"Cylurian" <fsromero (AT) hotmail (DOT) com> wrote

Quote:
I just want FMP to check a range of times and say, the time you were
finding is in that range. I just don't know if a field may have a
range.



Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.