Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Samir H.
  Where is Samir H.?
 Yogyakarta
 Indonesia
 Samir H.
 To: Rafiq Ahmed
  Where is Rafiq Ahmed?
 Islamabad
 Pakistan
 Rafiq Ahmed
 Tags
Subject: RE: coding
Thread ID: 288927 Message ID: 288934 # Views: 38 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Monday, December 27, 2010 2:09:32 AM         
   


> Hi Gurus,
> I want to check a range of dates from another range of date i.e.
>
> Checking range (1/1/2010-- 30/06/2010)
>
> ANOTHER RANGE (1/2/2009 -- 30/03/2010)
> (3/4/2010 -- 31/12/2010)
>
> I am not able to figure out as i can check a date from range of dates but how to check a range from a range of date.
>
> Any sujjestion... please

You didn't say what you want to check, I assume comparing the dates...
You can, among other possibilities, use arrays:

LOCAL ARRAY aDates1[1],aDates2[1]

* sample data...
FOR i=1 TO 5	&& 
	DIMENSION aDates1[i],aDates2[i]
	aDates1[i]=DATE()+i
	aDates2[i]=DATE()-3+i
NEXT 

cStr = ''
* compare...
FOR i=1 TO ALEN(aDates1,1)
	FOR j=1 TO ALEN(aDates2,1)
		cStr = cStr + 'Date1: '+TRANSFORM(aDates1[i])+' - date2: '+ TRANSFORM(aDates2[j])+CHR(13)
		IF aDates1[i]=aDates2[j]
			cStr = cStr + '--> above dates are same!'+CHR(13)
		ENDIF 
	NEXT j
	cStr = cStr + SPACE(5)+'--> next date1 to compare...'+CHR(13)
NEXT i

* display data...
cOldSafety=SET("Safety")
SET SAFETY OFF 
STRTOFILE(cStr,'tmp.tmp')
SET SAFETY &cOldSafety
MODIFY FILE tmp.tmp



Regards
Samir

ENTIRE THREAD

coding Posted by Rafiq Ahmed @ 12/26/2010 8:34:24 PM
RE: coding Posted by Samir H. @ 12/27/2010 2:09:32 AM
RE: coding Posted by Cetin Basoz @ 12/27/2010 8:24:38 AM