[AccessD] time window

bruce_bruen at mlc.com.au bruce_bruen at mlc.com.au
Thu Feb 12 20:21:25 CST 2004





I have ususally converted them to dates and let the system worry about the
logic. i.e.

cd1=int(now())+time1    'use today
if time2<= time 1 then
      cd2=int(now())+1+time2  'use tomorrow
else
      cd2=int(now())+time2
endif
cd3=Int(now())+time3

if cd3>=cd1 and cd3<cd2 then its in the window else its not.

However, note that there are anomolies when just using times. e.g.
window is 9:00am today to 8:00am tomorrow
7:00am today! is in the window.

B



                                                                                                                                               
                      "John W. Colby"                                                                                                          
                      <jwcolby at colbyconsulting.        To:       "AccessD" <AccessD at databaseadvisors.com>                                      
                      com>                             cc:                                                                                     
                      Sent by:                         Subject:  [AccessD] time window                                                         
                      accessd-bounces at databasea                                                                                                
                      dvisors.com                                                                                                              
                                                                                                                                               
                                                                                                                                               
                      13/02/2004 13:09                                                                                                         
                      Please respond to Access                                                                                                 
                      Developers discussion and                                                                                                
                      problem solving                                                                                                          
                                                                                                                                               
                                                                                                                                               




I need to be able to express a pure time window (not date related) from /
to
and test time() as being between (inside) this time window.  This process
doesn't work across midnight, i.e. 7:00 pm is "between" 6:00 pm and 1:00
am.
However if I just do a simple compare - 7:00 PM is >= 6:00 PM but it is not
<= 1:00 am.

It looks like a "if time 2 > time 1 then use simple test for time()"  "If
Time 2 < time 1 then invert the second time comparison"

Has anyone done this already?

John W. Colby
www.ColbyConsulting.com


_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list