Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Jignesh Parekh
  Where is Jignesh Parekh?
 Rajkot
 India
 Jignesh Parekh
 Tags
Subject: RE: How to Between Time???
Thread ID: 330923 Message ID: 331018 # Views: 28 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Sunday, December 25, 2011 6:09:04 PM         
   


> >
> >
> > Please Check
> >
> > SET HOURS TO 24
> > SET DATE BRITISH
> > LOCAL a as Datetime ,b as Datetime ,c as Datetime
> > a = CTOT('25/12/2011 03:00:00PM')
> > b = CTOT('25/12/2011 02:00:00PM')
> > c = CTOT('25/12/2011 12:00:00PM')
> > MESSAGEBOX(BETWEEN(a,b,c))
> >
> >
> > Return .F.
>
>
> The order of time in clock is
>
> 12:00:00 PM
> 02:00:00 PM
> 03:00:00 PM (03 is not between 12 & 2)
>
>
MESSAGEBOX(BETWEEN(a,b,c)) && gives .F.
> but
> MESSAGEBOX(BETWEEN(b,c,a)) && will give .T.

>
>
> Regards,
> Jignesh Parekh
> --------------------------------------------------------------------------------------------------------------------------------
> If better is possible, Good is not enough.

12 PM is midday. So
BETWEEN(2PM,12PM,3PM)
returns .T.
Easier if you use 24H settting
BETWEEN(14,12,15)
which is .T.

-Anders

ENTIRE THREAD

How to Between Time??? Posted by piyush Vaishnawswami @ 12/24/2011 2:50:38 PM
RE: How to Between Time??? Posted by Anil Sharma @ 12/24/2011 3:04:47 PM
RE: How to Between Time??? Posted by piyush Vaishnawswami @ 12/24/2011 3:19:34 PM
RE: How to Between Time??? Posted by Anil Sharma @ 12/24/2011 3:30:42 PM
RE: How to Between Time??? Posted by piyush Vaishnawswami @ 12/25/2011 11:15:42 AM
RE: How to Between Time??? Posted by Anders Altberg @ 12/25/2011 11:55:18 AM
RE: How to Between Time??? Posted by Jignesh Parekh @ 12/25/2011 2:29:53 PM
RE: How to Between Time??? Posted by Anders Altberg @ 12/25/2011 6:09:04 PM
RE: How to Between Time??? Posted by Anil Sharma @ 12/25/2011 2:35:37 PM
RE: How to Between Time??? Posted by Rahul Moudgill @ 12/25/2011 6:15:56 AM