Complex query with different conditions...
- From: jason.teen@xxxxxxxxx
- Date: 16 Jul 2006 17:51:15 -0700
Hi,
I have a table such as below and I want to write a query which says
"For each product, Exclude all Rows where Rate is 0 and Code is not D,
but if any of the rows for that product is found with an Indicator is
L, then only use that row and ignore the rest (just for that product)
I have tried some way, but never get the exact output I want and the
nested joins I think 3 or 4 in total, make it impossibly slow to run...
Any ideas??
Thanks..
tblOriginal
-------------------------------------------------------------------------
PRODUCT CODE RATE INDICTOR
-------------------------------------------------------------------------
One 1 23.00 P
One Z 0 P
One D 0 W
One 1 23.00 S
One Z 0 P
One D 0 W
Two 1 23.00 L
Two Z 0 W
Two D 0 W
Two 1 23.00 S
tblOutput
-------------------------------------------------------------------------
PRODUCT CODE RATE INDICTOR
-------------------------------------------------------------------------
One 1 23.00 P
One D 0 W
One 1 23.00 S
One D 0 W
Two 1 23.00 L
.
- Follow-Ups:
- Re: Complex query with different conditions...
- From: DFS
- Re: Complex query with different conditions...
- From: CDMAPoster
- Re: Complex query with different conditions...
- Prev by Date: Re: Viewing more than 10 records in a dropdown box on a DAP
- Next by Date: Re: Combo Box not displaying all rows
- Previous by thread: Combo Box not displaying all rows
- Next by thread: Re: Complex query with different conditions...
- Index(es):
Relevant Pages
|
|