• klanguedoc (5/6/2009)


    select distinct custno, currency, COUNT(currency) from tblSales

    group by custno, currency having currency = 'USD' or currency='CAD'

    order by custno

    Hi,

    from your codeing result for count of currency alwayes one,

    --only the customer having more than one currency

    select custno,COUNT(currency) from tblSales

    where currency in('USD','CAD')

    group by custno

    having COUNT(currency)>1

    --for all the records

    select custno,COUNT(currency) from tblSales

    where currency in('USD','CAD')

    group by custno

    ARUN SAS