We help IT Professionals succeed at work.

how do i grab these records?

raman takhar
raman takhar asked
on
116 Views
Last Modified: 2017-11-20
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
Comment
Watch Question

Pawan KumarDatabase Expert
Awarded 2016
Top Expert 2016

Commented:
Which database are u using?
Raghavendra HullurSoftware Developer
CERTIFIED EXPERT

Commented:
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.

Author

Commented:
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.

Author

Commented:
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
Senior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Raghavendra HullurSoftware Developer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
it works. Thank you guys
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
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
Raghavendra HullurSoftware Developer
CERTIFIED EXPERT

Commented:
Thanks mlmcc, is that a new feature or is it like that from earlier versions?
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
Been like that since at least CR8
I tried it before I posted to make sure

mlmcc
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.