Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP9 SQL Tip
Message
From
17/12/2004 13:31:58
 
 
To
17/12/2004 12:55:03
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00970107
Message ID:
00970126
Views:
19
>>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?
>
>vfp8 and before ( except trim this is equal )
>
>SELECT DISTINCT LEFT(JUSTFNAME(classloc),60) ClassLoc ;
>   FROM forms\techcalls.scx ;
>   WERE NOT EMPTY(ClassLoc) ;
>  INTO CURSOR crsLibs
>


Mark's point is the better handling, not new handling. With CAST() you can force it to be more what you want, in his example a VarChar, as when reading from a Memo you may not know the exact length you will return. In your example it is always left(60) instead of a varchar. A small issue indeed, but I believe it is what he was aiming at.


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
Previous
Reply
Map
View

Click here to load this message in the networking platform