Conditional Find Duplicates Query Help

D

Dave Allen

Hello, I'm trying to build a query that will do 3 things:

1. Find matching names within a database
2. Find matching dates within a database
3. Exclude an entire matched set if all dollar amounts within a matched set are $0.00

To clarify, I want to be sure that within a matched set of names and dates there must be at least one non-zero dollar amount.

Any help would be very much appreciated, I'm new to query writing and am in desperate need of assistance.

Thanks,

Dave

EggHeadCafe - Software Developer Portal of Choice
WPF DataGrid Custom Paging and Sorting
http://www.eggheadcafe.com/tutorial...f-32b2d802ae17/wpf-datagrid-custom-pagin.aspx
 
K

Krzysztof Naworyta

Select
name, date
from
table1
group by
name, date
having
count(*)>1
and
sum(amount)>0

--
KN

<Dave Allen> napisa³
| Hello, I'm trying to build a query that will do 3 things:
|
| 1. Find matching names within a database
| 2. Find matching dates within a database
| 3. Exclude an entire matched set if all dollar amounts within a matched
| set are $0.00
|
| To clarify, I want to be sure that within a matched set of names and
| dates there must be at least one non-zero dollar amount.
|
| Any help would be very much appreciated, I'm new to query writing and
| am in desperate need of assistance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top