Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Divide table monthwise
Message
De
21/02/2005 12:58:02
 
 
À
21/02/2005 11:57:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00988879
Message ID:
00988905
Vues:
29
>Dear Experts
>
>I have a table entitled "WEIGHTS", index on field "DATE"
>
>The date field has data as
>
>24/07/2004
>02/08/2004
>11/09/2004
>01/01/2005
>15/02/2005
>
>I want to divide this table into 12 tables, every table will hold data of a different month. For example the first table will be 072004.
>
>For this I wrote following codes
>
>FOR p_count = 1 TO 12
>    file_name = ALLTRIM(STR(p_count))
>       SELECT * FROM weights WHERE MONTH(date1) = p_count INTO TABLE d:\ahsan+(file_Name)
>NEXT
>CLOSE ALL
>
>But above codes retreive data of only last month as well as create one dbf instead of 12.
>
>Note: Index is on DATE field.
>
>Please help
FOR p_count = 1 TO 12
    sMonth= LTRIM(STR(p_count))
       SELECT * FROM weights WHERE MONTH(date1) = &sMonth INTO TABLE (d:\ahsan+m.sMonth)
NEXT
CLOSE ALL
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform