Ailsom F. Heringer (Osklen) wrote: > But CASE do not work with "< 0" . > > This is OK (0 is summed as it was 1): > SELECT SUM(CASE DISCOUNT WHEN 0 THEN 1 ELSE 0 END) from table > > But this one doesn´t work: > SELECT SUM(CASE DISCOUNT WHEN < 0 THEN DISCOUNT ELSE 0 END) from table > I believe you need a field before the < sign! Otherwise, you're comparing nothing to less than 0!
-- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com "Work smarter, not harder, with MBSS custom software solutions!" _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.