>>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)