Help with mssql select statement

Hi guys, first time on the forum , and new to scriptcase.

I’m having problems with the following select statement.

$check_sql = “SELECT PROMISE_DATE FROM dbo.CUST_ORDER_LINE WHERE CUST_ORDER_LINE.CUST_ORDER_ID like '” . {CUSTOMER_ORDER} . “’ AND CUST_ORDER_LINE.LINE_NO = '” . {LINE_NO} . "’ ";
sc_lookup(rs, $check_sql);

its throughing me the following error.

(mssqlnative): SELECT PROMISE_DATE FROM CUST_ORDER_LINE WHERE CUST_ORDER_LINE.CUST_ORDER_ID like ‘C04998’ AND CUST_ORDER_LINE.LINE_NO = ‘2’
208: SQLState: 42S02 Error Code: 208 Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid object name ‘CUST_ORDER_LINE’.
ADOConnection._Execute(SELECT PROMISE_DATE FROM CUST_ORDER_LINE WHERE CUST_ORDER_LINE.CUST_ORDER_ID like ‘C04998’ AND CUST_ORDER_LINE.LINE_NO = ‘2’ …, false) % line 1149, file: adodb.inc.php
ADOConnection.Execute(SELECT PROMISE_DATE FROM CUST_ORDER_LINE WHERE CUST_ORDER_LINE.CUST_ORDER_ID like ‘C04998’ AND CUST_ORDER_LINE.LINE_NO = ‘2’ …) % line 5190, file: form_dbo_promise_date_change_request_apl.php
form_dbo_promise_date_change_request_apl.get_promise() % line 5147, file: form_dbo_promise_date_change_request_apl.php
form_dbo_promise_date_change_request_apl.LINE_NO_onChange() % line 1227, file: form_dbo_promise_date_change_request_apl.php
form_dbo_promise_date_change_request_apl.controle() % line 2582, file: index.php

Try this whith a blank app

the result is the $val, so clever u is…waste a space :stuck_out_tongue:

sorry walterpalisca, i realize i poorly documented my idea,
I’m not used to this editor yet,
so to be clearer,
$val = “SELECT promise_date FROM cust_order_line WHERE cust_order_id =‘ C04998 ’AND line_no =‘ 2 ’”;
sc_lookup (rs, $val);

print_r ({rs});

(if your request is correct, you will find the data in your print_r, the error is undoubtedly either in the formulation, or in the data which could be null or others, good luck)