Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP9 SQL Tip
Message
De
17/12/2004 12:41:19
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
00970107
Message ID:
00970116
Vues:
18
>>With the new CAST function, you can now handle VFP memo fields better. For example, I want a distinct set of ClassLib names used in a form:
>SELECT DISTINCT CAST(JUSTFNAME(classloc) as V(60)) ClassLoc ;
>   FROM forms\techcalls.scx ;
>   WHERE NOT EMPTY(ClassLoc) ;
>   INTO CURSOR crsLibs
>Cool, eh?



Oooh. I like that one! Thx.

Variation:
I have a memo field called ErrorDesc. It contains several lines detailing errors encountered when processign the record. The first line always contains datetime plus some title. The other line(s) contain more info. With your example I can easily extract the first line only of every memo (record) as defined by CHR(13)
SELECT DISTINCT CAST(Left(errordesc,At(Chr(13),errordesc)-1) as V(100)) errordesc ;
   FROM MyTable ;
   WHERE NOT EMPTY(errordesc)


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform