I want to export some data from 3 tables into an Excel spreadsheet. I've included the SELECT command below. Everything is fine except IT ONLY EXPORTS THE FIRST CHARACTER FROM THE staff_list.notes FIELD (which is a memo field with the phone extension). Note: I put the extensions in a memo field since only about 100 of the 400 employee records actually have extensions. If I had created it as a field, most of the records would be empty.
[sig][/sig]
Code:
SELECT DISTINCT trim(lastname) AS "LASTNAME", trim(firstname) AS "FIRSTNAME", trim(e_mail) AS "EMAIL", trim(position) AS "TITLE",trim(market.market) AS "MARKET",trim(offices.phone1) AS "OFFICEPHONE", staff_list.notes AS "EXT", trim(staff_list.phone2) AS "HOMEPHONE";
FROM Staff_list,Offices,Market;
WHERE SUBSTR(Offices.office_no,1,3) = SUBSTR(Staff_list.office_no,1,3);
AND staff_list.market = market.market;
AND NOT EMPTY (staff_list.phone1);
AND BETWEEN(val(trim(staff_list.office_no)),3,10)=.f. = .T.;
INTO TABLE "Eldred:Desktop Folder:stafflist.xls";
ORDER BY LASTNAME