Can someone see the error in this script code? It is for 3700 version 5.2. It works when called through dbisql. When calling direct it gives the error "Syntax error - Select was not expected here. It also worked in version 4.x with the old connection. Micros has spent a few hours looking at it but cant figure it out either. Thanks in advance.
Code:
CONNECT USING 'DSN=micros;UID=custom;PWD=custom'
select cast(inven_itm_id as numeric(6)), cast(ordr_qty as int) from micros.veo_po_inven_itm_dtl
where po_seq=(select Max(po_seq) from micros.veo_ordr_itm_po_dtl
and vndr_name='Connect Logistics')
order by name;
output to D:\ConnectExport\Connect.csv