Link to home
Start Free TrialLog in
Avatar of raman takhar
raman takhar

asked on

how do i grab these records?

hi im new on crystal so please bear with me
for example this is my data

EMPID     COMPANY     DEPT
12345          100              22
23456           100             23
34567           200             33
45667           200              34
11111           200              35
11112           200               36
11113           200               37
11114            300              11
11115            300               12
11116            300               13
11117            300                14
11118            300                15

lets say I need to capture empID in company 100 and on 200 I only need dept 35,36 and on 300 I need depts 11,12,13
how will I be able to get that? lets say there are more data in it with lots of departments but I only need specific ones from specific companies
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Which database are u using?
Avatar of Raghavendra Hullur
Hi,
If you are using command object for free hand sql, then you can include where clauses for the respective conditions. And if you want to do it thru parameters at Crystal Reports level, then you can use record selection with filter conditions using the parameter values. Provide more details on how you want to achieve this.
Avatar of raman takhar
raman takhar

ASKER

ok let me make it clearer sorry. im using crystal reports. So every employee has a Company # and a Dept #. I need to capture specific Company numbers with specific Department #. like on the table I showed earlier. what would be the best way to capture them. I tried doing on record selection filtering Companys and filtering departments but there are similar department numbers between companies for example company A can have dept 1 and company B can have dept 1 also and so does C. but lets say I only need company 1 from A and not from B and C.
so I need to capture all in Company 700 and 701 and
In in company 400, select only the following depts:
7550, 7800, 7801,7802,7803,7805,7806,8133,8800,8801,8807,8808,8813 and
In company 100, select only the following departments:
7550,7551,7556,7557,7800,8800,8813

so if you see the departments in the Companies are similar. but for some I have to capture everyone and for some I need specific ones
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
it works. Thank you guys
Raghavendra Hullur - There was no need to change the SQL I provided.  Crystal converts it automatically for you so you can use = with lists as I did.

mlmcc
Thanks mlmcc, is that a new feature or is it like that from earlier versions?
Been like that since at least CR8
I tried it before I posted to make sure

mlmcc