> Is it ok to index on fields in other tables. I need to create many such indexes with a combination of fields from table1 and table2.
> It is working but is it safe and reliable?
There were reasons why I used index expressions with another table (before SQL Statements were introduced).
Ex.:
Organizational table: (Orgntbl.DBF)
Orgncode: 1001
OrgnDesc: Administrative Department
.
.
.
Employee Table: (EmpMast.DBF)
EmpCode : 149047
EmpName : Relucio, Rene M.
OrgnCode: 1001
.
.
.
So when I needed to print a report Sorted by OrganDesc and by EmpName:
Select 1
Use EmpMast
sele 2
Use Orgntbl order Orgncode
sele 1
set relation to Empmast.orgncode into orgntbl
Index on Orgntbl.OrgnDesc+Empmast.EmpName to PrOrgEmp
Today, I use SQL:
Select Empmast.Empname, Orgntbl.Orgdesc from Empmast ;
left join orgntbl on Empmast.OrgnCode = Orgntbl.orgncode ;
order by Orgntbl.Orgdesc, Empmast.Empname