Is there a way to derive the underlying table and field for a given column name?
For Example:
SELECT Memberships.Description AS MembershipName, CustomerMemberships.Date as Enrolled, Customers.FirstName+' '+Customers.LastName As Person
FROM Memberships INNER JOIN
CustomerMemberships ON Memberships.MembershipID = CustomerMemberships.MembershipID INNER JOIN
Customers ON CustomerMemberships.CustomerID = Customers.CustomerID
Given the following column name "MembershipName"
Is there a method to derive "Description" as the underlying Field and "Memberships" as the underlying Table?
I realize the circumstances that where Table and field names could not be derived, such as the "Person" column which results from concatenated fields.
Underlying Table & Field corresponding with Column
Re: Underlying Table & Field corresponding with Column
Hello,
When you know the field alias, you can retrieve the real field name, the table alias and name in the following way:
When you know the field alias, you can retrieve the real field name, the table alias and name in the following way:
Code: Select all
TCRFieldDesc(UniQuery1.GetFieldDesc('MembershipName')).ActualName; <-- the real field name
TCRFieldDesc(UniQuery1.GetFieldDesc('MembershipName')).TableInfo.TableName; <-- the real table name
TCRFieldDesc(UniQuery1.GetFieldDesc('MembershipName')).TableInfo.TableAlias; <-- the table aliasRe: Underlying Table & Field corresponding with Column
Perfect. Thank you. 
Re: Underlying Table & Field corresponding with Column
hello,
Glad to see that the problem was solved. If you have any other questions, feel free to contact us.
Glad to see that the problem was solved. If you have any other questions, feel free to contact us.