BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Time interval

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
mARCELO
Guest





PostPosted: Fri Mar 18, 2005 2:48 pm    Post subject: Time interval Reply with quote




In my table i have this data:

Initial Final Period
06:00 13:59 1
14:00 21:59 2
22:00 05:59 3


I will specify a initial and final time, and i want know what period is
this hours, like:

08:00 - 10:00 - at the period 1

03:00 - 03:30 - at the period 3

21:00 - 03:30 - at the period 2,3 and so on!..


Any sugestions?





Back to top
Barak zabari
Guest





PostPosted: Sun Mar 20, 2005 10:21 am    Post subject: Re: Time interval Reply with quote



I'm giving the idea not the exact SQL

Select 1, Initial,final
where (Initial>= 06:00 and Initial <14:00) (catch if the initial is in
range)
Or (Final>= 06:00 and Final <14:00) (catch if the Final is in range)
Or (Final >=14:00 and Initial <06:00) (Catch if they time start before and
end after)
Union
Select 2, Initial,final
where (Initial>= 14:00 and Initial < 22:00)
Or (Final>= 08:00 and Final <12:00)
Or (Final >=22:00 and Initial <14:00)

Etc....




"mARCELO"
Quote:

In my table i have this data:

Initial Final Period
06:00 13:59 1
14:00 21:59 2
22:00 05:59 3


I will specify a initial and final time, and i want know what period
is
this hours, like:

08:00 - 10:00 - at the period 1

03:00 - 03:30 - at the period 3

21:00 - 03:30 - at the period 2,3 and so on!..


Any sugestions?








Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.