Home Search

DriveWorks Pro 21
TableGetColumnIndexByName

Send Feedback

TableGetColumnIndexByName

Gets the index of a column based on its name.

Syntax

TableGetColumnIndexByName([Table or Table Name], [Column Name], [Ignore Case])

Where:

Table or Table Name is the Table in which to lookup the index of the column.

Column Name is the name of the column to find the index of.

Ignore Case (Optional) is TRUE (or blank) to ignore case, FALSE to be case sensitive.

Examples

RuleMeaning
TableGetColumnIndexByName(DWGroupTableCustomers,"customername")From the table below this will return the column index 1, ignoring the case of the specified column name.
TableGetColumnIndexByName(DWGroupTableCustomers,"city",TRUE)From the table below this will return the column index 2, ignoring the case of the specified column name.
TableGetColumnIndexByName(DWGroupTableCustomers,"Country",FALSE)From the table below this will return the column index 3, matching the case of the specified column name.
If the case does not match, or the column name is not found, #Value! will be returned.

Example Data

DWGroupTableCustomers

CustomerNameCityCountry
Amazon WarriorsParisFrance
Bolton BurnersBostonUnited States
Boston BullsHanoverGermany
Cambridge CatsParisFrance