Click to See Complete Forum and Search --> : Little help on simple filter


doinkxs
December 8th, 2005, 04:58 AM
Hi all,
Before discribing situation i will say that im not programer and dont know much of it
Im using crystal reports 8

Here is situation:

I use data from scala database, enter column name and crystal reports show me (in my case) two colums: first is product code and second is warehouse in wich this product code is, for example i see:

Product Warehouse
code

2146 01
2160072 12
2178 01
2185 01
2199 05
221475 01
221541 01
221676 01
2222 01
2222 12
2224 12


Question: How to set filters or program formula that crystal reports show me only values from products wich are in both warehouses 01 and 12.
In this case:

Product Warehouse
code

2222 01
2222 12

I would be very pleased if you could explain me.
Thanx.

Madhi
December 27th, 2005, 06:19 AM
Create a View or stored procedure having this code

Select * from yourTable where Productcode in
(
Select Productcode from yourTable
where warehousecode in(01,02) group by Productcode
having count(*)=2
) T