Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Algorithm for missing dates.
Message
 
 
To
30/07/2009 17:13:13
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01415572
Message ID:
01415576
Views:
94
This message has been marked as a message which has helped to the initial question of the thread.
Chris,
create cursor AllDates( d1 d )
ldStart = some start date
ldEnd = some end date
do while ( ldStart <= ldEnd )
   insert into AllDates values ( ldStart )
   ldStart = ldStart + 1
enddo

select AllDates.d1, x.* 
   from AllDates ;
   left join x ;
      on AllDates.d1 = x.TheDate 
null values in the x.* columns are missing dates

>I have a bunch of single letter codes for each date that I'm trying to string together, however the data may be missing dates for weekends and holidays. The result should look something like "ABBAC..CB.AA..BBAB....BACA"
>
>I can put the date, week, day of week, and letter code into an array with an SQL statement and walk the array - adding the weekend breaks seems easy, but I'm having difficulty with missing dates during the week. Can anyone help me with an algorithm or faster way to do this?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform