select distinct
i.itemnumber
sum(i.qty) as invqty
from [your inventory table name here] i
group by i.itemnumber
having sum(i.qty) > 0
On 12/3/06, Terry Troxel <[EMAIL PROTECTED]> wrote:
>
> I am having a senior moment and could use some help with a
> sql select query I am attempting to use to populate a
> listbox with only those items that have inventory.
>
> SELECT DISTINCT inventory.ItemNumber, SUM(inventory.qty) as
> invqty where invqty > 0
>
> And I get the error I am not using 'ItenNumber' as part of
> an aggregate function.
>
> I have fixed this in the past, but am drawing a blank.
>
> Terry
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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/CF-Talk/message.cfm/messageid:262657
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4