>>Hello All,
>>
>>I have an SQL statement that LEFT joins two tables. When the table are joined a .null. is placed in fields where there was no data in the second table. One of those fields is a memo field. What I am trying to do is prevent the .null. from being placed in the memo field. Here is the code I am trying. The field extratext is the memo field.
>>
>>
>>SELECT tmpShops.*, shopques.*, ;
>> IIF(ISNULL(shopextr.extratitle), "", shopextr.extratitle) AS extratitle, ;
>> IIF(ISNULL(shopextr.extratext), "", shopextr.extratext) AS extratext ;
>> FROM tmpShops, shopques LEFT OUTER JOIN shopextr ;
>> ON Shopques.shopquesid = shopextr.shopquesid ;
>> WHERE (shopques.shopid = tmpShops.shopid) ;
>> AND (shopques.shopid IN (SELECT shopid ;
>> FROM tmpShops)) ;
>> INTO CURSOR tmpExport
>>
>>
>>When I try to execute the SQl statement a get a "Operation invalid for a Memo, ..." error. Can anyone help me?
>>
>>Thanks.
>>
>>Chris
>What version of VFP are you using? You can use ISNULL() on memo fields. Some >things you can't do (which I don't see you doing) are:
>1. Index on memo field
>2. Join on memo field
>3. Group by memo field
>Larry Miller
>MCSD, MVP Visual FoxPro
>LMiller3@bellatlantic.net
>Never let formal education get in the way of your learning. -- mark Twain
Larry,
I am using VFP 6.0. Actually, I didn't put my full SQL statement before. I am actually doing a UNION also. Here is my complete code.
SELECT tmpShops.*, shopques.*, ;
IIF(ISNULL(shopextr.extratitle), "", shopextr.extratitle) AS extratitle, ;
IIF(ISNULL(shopextr.extratext), "", shopextr.extratext) AS extratext ;
FROM tmpShops, shopques LEFT OUTER JOIN shopextr ;
ON Shopques.shopquesid = shopextr.shopquesid ;
WHERE (shopques.shopid = tmpShops.shopid) ;
AND (shopques.shopid IN (SELECT shopid ;
FROM tmpShops)) ;
INTO CURSOR tmpExport ;
UNION ;
SELECT tmpShops.*, cursques.*, ;
IIF(ISNULL(cursextr.extratitle), "", cursextr.extratitle) AS extratitle, ;
IIF(ISNULL(cursextr.extratext), "", cursextr.extratext) AS extratext ;
FROM tmpShops, cursques LEFT OUTER JOIN cursextr ;
ON cursques.shopquesid = cursextr.shopquesid ;
WHERE (cursques.shopid = tmpShops.shopid) ;
AND (cursques.shopid IN (SELECT shopid ;
FROM tmpShops))
I thought the problem was with the ISNULL statement, but it looks like I am wrong. What confuses my is that if I just let FoxPro put the .null. in the memo fields the UNION will work fine. But when I try to stop the .null. it gives me the error I listed above.
Chris
Chris Frybarger
IET, Inc.
3539 Glendale Ave.
Toledo, OH 43614
Phone: (419) 385-1233
Fax: (419) 385-0885