>>>Hi,
>>>
>>>I am trying, and failing, to include a memo field in a UNIONed SQL SELECT. I've pared the statement down to the following:
>>>
>>>
>>>SELECT app_activitycomments ;
>>> FROM appointments ;
>>> INTO CURSOR c_Temp ;
>>> WHERE !app_activity AND app_clientfk > 0 AND app_GroupnameFK=0 ;
>>> UNION ;
>>> SELECT app_activitycomments ;
>>> FROM appointments;
>>> WHERE !app_activity AND app_clientfk=0 ;
>>> UNION ;
>>> SELECT app_activitycomments ;
>>> FROM appointments ;
>>> WHERE app_activity
>>>
>>>
>>>and i get the error:
>>>
>>>"Operation is invalid for a Memo, Blob, General or Picture field"
>>>
>>>I can't have a memo in a UNION SQL SELECT statement?
>>>
>>>TIA, j
>>
>>Jill,
>>
>>With the UNION ALL you may end up with duplicate records
>>
>>The statement above can be rewritten without a UNION
>>
>>
>>SELECT app_activitycomments ;
>> FROM appointments ;
>> INTO CURSOR c_Temp ;
>> WHERE ( app_activity ) ;
>> or ( app_clientfk > 0 AND app_GroupnameFK=0 ) ;
>> or ( app_clientfk=0 )
>>
>>
>>
>>SELECT app_activitycomments ;
>> FROM appointments ;
>> INTO CURSOR c_Temp ;
>> WHERE ( app_activity ) ;
>> or ( app_clientfk = 0 ) ;
>> or ( app_GroupnameFK=0 )
>>
>>
>
>Hi Gregory,
>
>Thanks for your input...but, the SELECT i posted here was a stripped down version (to illustrate my specific problem)...there are many other fields and tables involved in the real statement.
>
>I ended up doing the UNION ALL, then applied a UNIQUE index to get the unique records I needed.
>
>Thanks, j
hi Jill,
IC.
You could also safely select with union some pk or id of appointments into a cursor. Then join the cursor with appointments.
Gregory