> SELECT MAX(PaymentNo) INTO MaxPaymentNo IND iv1 FROM PAYMENTS WHERE OrderNo > = 9596096 > > sqlcode returns 0 even though the record does not exist. > MaxPaymentNo becomes 0 and the indicator iv1 is also 0 > > Is this the way it's supposed to be?
Yes, the aggregate functions always succeed, if if there are no rows in the result set. -- Larry
