Hi, how to convert string to column name? I want to filter a table and get the value of a column but the name of the column is obtained by the variable i
Notice of Maintenance on October 9th. Click here for further details.
Hi, how to convert string to column name? I want to filter a table and get the value of a column but the name of the column is obtained by the variable i
Hi,
I'm not really sure about your request. But I think assign or evalue.
If not, other option is use SQL inside 4GL:
Local Clbfile WSQL_CMD
If [F:TSQ]XARGCSALDO<>2
Case [F:TSQ]XARGTSALDO
When 1 : WSQL_CMD="select sum(AMTNOTL_0) from XARGACOH where ACOSQH_0='"+PACOSQH+"'"
When 2 : WSQL_CMD="select sum(AMTATIL_0) from XARGACOH where ACOSQH_0='"+PACOSQH+"'"
Endcase
Else
Case [F:TSQ]XARGTSALDO
When 1 : WSQL_CMD="select sum(AMTNOT_0) from XARGACOH where ACOSQH_0='"+PACOSQH+"'"
When 2 : WSQL_CMD="select sum(AMTATI_0) from XARGACOH where ACOSQH_0='"+PACOSQH+"'"
Endcase
Endif
If PTYP=1 and PSOH<>''
WSQL_CMD+=" and ACOSOH_0<>'" +PSOH+"'"
Endif
For (Decimal SALDO) From num$((GTYPDBA*2)+1) Sql WSQL_CMD As [SQL_SAL]
WSALDO=[SQL_SAL]SALDO
Next
Regards,
Thank you
I am very glad that you answered my question
*Community Hub is the new name for Sage City