Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Divide table monthwise
Message
De
21/02/2005 19:18:47
 
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:
00989077
Vues:
51
>>>>>Dear Sir,
>>>>>
>>>>>When I run your codes it shows following error message
>>>>>
>>>>>Invalid path or file name
>>>>>
>>>>>Please help again
>>>>
>>>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
>>>
>>>May be quickly is:
>>>
>>>>FOR p_count = 1 TO 12
>>>>    sMonth= "d:\ahsan"+LTRIM(STR(p_count))
>>>>    SELECT * FROM weights WHERE MONTH(date1) = p_count INTO TABLE (m.smonth)
>>>>NEXT
>>>>CLOSE ALL
>>>
>>
>>Yes for a short table, but the difference is of some ms,
>>for a large table, the macro put a literal integer, and this is faster.
>>On any case, sure you have to put a
>>
>>... MONTH(date1) = m.p_count ...
>>
>
>O'key Fabio I forget m.p_count... but what You say for "WHERE MONTH(date1) = &sMonth"
>May be better is "WHERE MONTH(date1) = m.p_count"

If a index to MONTH(date1) don't exists,
for a large table:
WHERE MONTH(date1) = 1
is faster because VFP search the variable for every record.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform