Claudine,
There are multiple payment records for a given order
Each payment is assigned a PaymentNo.
I need to know the highest PaymentNo in order to insert the next payment.
Bernie
----- Original Message ----- From: "Claudine Robbins" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[email protected]>
Sent: Tuesday, July 05, 2005 3:05 PM
Subject: [RBG7-L] - RE: Select Max question


Bernie,

This isn't going to work with a where clause...

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Bernard Lis
Sent: Tuesday, July 05, 2005 1:47 PM
To: RBG7-L Mailing List
Subject: [RBG7-L] - Select Max question

set var MaxPaymentNo int=null
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?

Bernie Lis



Reply via email to