|
Hi, >> This reminds me of a pending question I've had that might >> help. I've checked the manual, but can someone refresh my >> mind on the SQL function that takes one value from a list of >> two, where one is a database value, and the other is a value >> to select in case the database value is null? (Or something >> like that?) > I believe you're thinking of COALESCE: > select lastname, firstname, coalesce(char(termination_date), 'ACTIVE') from > employees Sounds more like "CASE" for me; in this sample i'm setting a field to be used in a HTML class="xxx" later on: SELECT ..., CASE WHEN COENDT > COENDP THEN 'OVERDUE' ELSE '' END AS CLASSCOENDT, CASE WHEN SUM(CODBWR) >= SUM(CODBWP) THEN 'OK' WHEN SUM(CODBWR) > 0 AND SUM(CODBWR) < SUM(CODBWP) THEN 'ATTN' WHEN SUM(CODBWR) < 0 THEN 'ALERT' ELSE '' END AS CLASSCODB, ... 0.02 Euro best regards, Anton Gombkötö
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.