>//ALLTRIM(dst.ccity)+", "+ALLTRIM(dst.cstate) as dest_city, ; >concat(TRIM(dst.ccity), ", ",TRIM(dst.cstate) as dest_city, <-- missing parenthesis here >//LEFT JOIN c_d!users ue ON ue.uid = x.eby ; >LEFT JOIN users ue ON ue.uid = x.eby > >//WHERE cmp.cname like lcCname ; >WHERE cmp.cname like lcCname ***** NOTE: this is a local variable in VFP! ***** // so you'd need to insert a '<<lcCname>>' here in textmerge to get the right // value in the command. Same goes for other VFP variables. > >//AND TTOD(rdt) >= ldDateLow ; > >//AND TTOD(rdt) <= ldDateHigh ; // instead ot ttod you'd simply have to have '<<ldDateLow>>' compared with the // rdt field, probably with a ... and rdt between '...' and '...' >//AND DELETED() = .F. ; // there are no deleted records. this line goes away. >//AND x.acc = lcAccID ; > >//INTO CURSOR curDnumList READWRITE > >[NOTE: Decided to stop here when I saw the "INTO CURSOR" code. Hold all horses! :^)] >The "into cursor" part is unnecessary, unless you want to use it for another select while you're connected. There should be something telling MySQL to direct the resultset into a temporary table. I know I saw it somewhere, but I probably have just two days more experience with MySql than you have, so... look it up.