PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Find out the column selected in a table
Find out the column selected in a table
Débuté par Paul Ashton, 04 mar. 2020 18:26 - 3 réponses
Posté le 04 mars 2020 - 18:26
Hi all,

Can anyone help me with this query.

I'm trying to find a value in a column of a table

I use the following code but all it returns is the number of the line i'm on in the table, not the actual value that is in that line in column "COL_Cust_GUID"

sSitGUID = TableSelect(TABLE_QRY_Previous_Addresses,COL_Cust_GUID)


Thank you in advance
Paul
Posté le 05 mars 2020 - 02:47
the value in a column of a table is TableName.ColName[LineNumber]
So if you know the line and the column name, you are golden.
Posté le 05 mars 2020 - 10:23
Argus wrote:
the value in a column of a table is TableName.ColName[LineNumber]
So if you know the line and the column name, you are golden.


Hi Argus, thank you for the reply.

I've changed my code to the following but still get no value back from the column. My nLineNumber variable is showing the correct value in debug but sSitGUID is still blank

sSitGUID is string
nLineNumber is int

nLineNumber = TableSelect(TABLE_QRY_Previous_Addresses)

sSitGUID = TABLE_QRY_Previous_Addresses.COL_SIT_GUID[nLineNumber]


Thank you
Paul
Posté le 05 mars 2020 - 11:38
It's ok,

I've got it working now with the following code....

IF TableSelect(TABLE_QRY_Previous_Addresses) = -1 THEN RETURN

sSitGUID is string

IF HReadSeekFirst(Site,GUID,COL_SIT_GUID) = True THEN
sSitGUID = COL_SIT_GUID
END


Thank you
Paul.