Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Tore Bleken
  Where is Tore Bleken?
 Stokke
 Norway
 Tore Bleken
 To: Shaheryar Rashed
  Where is Shaheryar Rashed?
 Multan
 Pakistan
 Shaheryar Rashed
 Tags
Subject: RE: how to ?
Thread ID: 395462 Message ID: 395463 # Views: 57 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Wednesday, January 15, 2014 9:06:48 AM         
   


> Hi experts
>
> i have 2 dates at form suppose date(2014,07,01) and date(2014,07,31)
>
> i have to append them in a table like:
> date
> 01/07/2014
> 02/07/2014
> 03/07/2014
> 04/07/2014
>
> to ......
>
> 31/07/2014
> do i code it like this :
>
>
Select newbook
> Public ldM1, ldm2
> ldM1 = date(2014,07,01) 
> ldM2 = date(2014,07,31) 
> ldm3 = ldm1
> scan
>  if ldm3 < ldm2
>   Append Blank
>   Replace Date With ldM3
>   ldM3 = ldM1 +1
>  ENDIF 	
> endscan  
> 

> guide me a comprihansive way

Local ldM1, ldm2 && NOT public, public variables sould be avoided!!
ldM1 = date(2014,07,01) 
ldM2 = date(2014,07,31) 
For lnX = 0 to ldM2 - ldM1
   Insert into newbook (date) values (ldM1 + lnX)
Endfor
endscan

And by the way,please give a thread a meaningful text. "How to" isn't very helpful, "How to fill a table with dates" is telling more.

There's a fine line between helping and adding to the confusion.

How to create sample data

ENTIRE THREAD

how to ? Posted by Shaheryar Rashed @ 1/15/2014 8:45:08 AM
RE: how to ? Posted by Tore Bleken @ 1/15/2014 9:06:48 AM
RE: how to ? Posted by Shaheryar Rashed @ 1/15/2014 9:25:47 AM
RE: how to ? Posted by Tore Bleken @ 1/15/2014 9:29:34 AM
RE: how to ? Posted by Zia Mughal @ 1/15/2014 10:52:01 AM
RE: how to ? Posted by Tore Bleken @ 1/15/2014 10:59:01 AM
RE: how to ? Posted by Zia Mughal @ 1/15/2014 9:11:57 AM
RE: how to ? Posted by Borislav Borissov @ 1/15/2014 9:15:58 AM