Ailsom F. Heringer (Osklen) <> wrote:
> I have write a SELECT command to sum "TicketTotal" grouping by
> "ShopNo"
> with distinct values of "TicketTotal" based on "ShopNo" and
> "TicketNO".
>
> I cannot use "ItemTotal", because in some records this column is null.
>
> Can someone help me with this syntax ?
>
Select ShopNO, TicketNO, sum(isNull(TicketTotal,0))
>From yourTable
Group by ShopNO, TicketNO
Where shopno is not null
Stephen Russell
DBA / .Net Developer
Memphis TN 38115
901.246-0159
"A good way to judge people is by observing how they treat those who
can do them absolutely no good." ---Unknown
http://spaces.msn.com/members/srussell/
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.8/716 - Release Date: 3/9/2007
6:53 PM
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** 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.