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
Crystal Reports

Avatar of undefined
Last Comment
Mike McCracken

8/22/2022 - Mon
Pawan Kumar

Which database are u using?
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.
ASKER
raman takhar

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.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER
raman takhar

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
Mike McCracken

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
raman takhar

it works. Thank you guys
Mike McCracken

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
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Raghavendra Hullur

Thanks mlmcc, is that a new feature or is it like that from earlier versions?
Mike McCracken

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

mlmcc