Print Page | Close Window

Sub Query

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=13654
Printed Date: 02 May 2024 at 7:32pm


Topic: Sub Query
Posted By: taoh
Subject: Sub Query
Date Posted: 01 Jul 2011 at 3:13am
Hi

I've come back to CR Reporting after a long layoff and forgotten most of what I used to use, so I need help.

I am using CR XI to query Active directory. I want to produce a list of all groups and their  users.
As far as I can see there is no way via ADO to created the required SQL Statement.

So far I have two test reorts which do what I want.
The first
SELECT distinguishedName FROM 'LDAP://dc=Blah,dc=local'
WHERE  objectCategory='Group'
and
SELECT sAMAccountName, distinguishedName
     FROM 'LDAP://dc=Blah,dc=local'
     WHERE objectClass='person' AND  memberOf=
'CN=mygroup,DC=Blah,DC=local'

Is there any way of creating a report using the second qury based on the results of the first query.
e.g. using the distinguishedName from query 1 instead of 
CN=myGroup,DC=Blah,DC=local

Cheers
Taoh




Replies:
Posted By: sharona
Date Posted: 06 Jul 2011 at 4:55am
put it in a stored procedure feed the first query into a temp table
then the 2nd query i would join the temp table and use it as my final query


-------------
sharona



Print Page | Close Window