• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1032
  • Last Modified:

DLookup equivelant in Crystal

Hi experts,

I am relatively new to Crtsyal Reporting and would usually use Ms Access reports but my manager has asked me to start using crystal mainly because the reports will soon be going into a webpage.
My question is what is the Crystal equivelant of a Dlookup, attached print screen explains the problem better...

Many Thanks,
Dean
print-screen.doc
0
deanlee17
Asked:
deanlee17
  • 3
  • 3
1 Solution
 
peter57rCommented:
Your best approach is gong to be to include the 'lookup' tables in the data source and link them appropriately.

0
 
deanlee17Author Commented:
Hi Peter,

Can u define the 'lookup' table? In the access database its a passthru query, which my crtsyal report does pull thru, but i didnt think i could use Dlookup on a text box in Crystal

Thanks.
0
 
peter57rCommented:
The lookup table is the table you would have used in the DLookup() function.
0
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 
deanlee17Author Commented:
Hi Peter,

Ive included the data source that the Dlookup used so it is now visible thru my crystal report. What is crystal syntax required? Im assuming its obv a count function. In Access my Dlookup function is....

=DCount("[fundingstream]","targetstudents","[fundingstream]=21  AND [Reference]= '" & [Reference] & "'")

Thanks.
0
 
peter57rCommented:
That's a step more complicated than I expected.

I think we need to backtrack.

Instead of including the table, include a sql statement via the AddCommand option .
The sql statement can do the calculation you need.

It needs to be written in the sql dialect of your database but it will be something like..

Select [Reference], Count(*) as MyCount from targetstudents where fundingstream =21 group by Reference

You can then link this command to the main table using the reference and the count is immediately available to the report.
0
 
deanlee17Author Commented:
Excellent Peter thanks very much
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now