Syntax for Nested Select Statement
I am having some dramas with this select statement. For the records in cust_info, when agencynum ne 0, I want to get the corresponding name field from stravelag into cust_info-name and write it. (along with all the other data in that row of cust_info)
I keep getting errors in the final select statement. Any ideas would be much appreciated.
check not scustom-id is initial.
select fldate bookid carrid connid class agencynum from sbook
where customid = scustom-id
order by fldate.
if cust_info-agencynum = 0.
write:/ 'Agency Unknown',
elseif cust_info-agencynum > 0.
select single name from stravelag
where agencynum = cust_info-agencynum.