Andrew Scott wrote: > > Any ideas how to return just the $amount rather than all the rows based on > the number of days? > If I understand the logic of what you are trying to do, then try something like...
SELECT (SUM(ToDay - FromDay + 1) * min(CASE Amount WHEN 0 THEN NULL ELSE Amount END)) FROM SomeTable WHERE ToDay < 12 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2649 Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6
