Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup Function Crystal Syntax

Status
Not open for further replies.

AVAS

Programmer
Jan 10, 2003
16
CY
is there a Lookup() funtion or something i can use in a formula to get the value of a certain field? (like The VFP Lookup() Function)

 
Crystal doesn't really work like a Lookup() against a database, you can use formulas/summary functions/running totals to determine if a value/condition exists, and you can use SQL to determine if a value/condition exists at the data extraction point, and then create a new field, or filter rows.

Perhaps if you explain what it is you intend to do, someone can help you.

-k kai@informeddatadecisions.com
 
Can i use a SELECT SQL command in a formula like

SELECT TABLEA.COLUMNA
FROM TABLEA
WHERE COLUMNA="VALUEA"

and Pass That Value to a variable?
 
Dear AVAS,


If this table TableA is selected to report on in your report then this is the correct syntax in the select expert:

Report Menu Bar Report/Edit Selection formula/Record

{TableA.ColumnA} = 'ValueA'


Let's say that you only have TableA selected on which to report and you have only one field on the report: ColumnA.

The SQL Query that crystal passes to the database will look pretty much like what you have there.

ro

Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Hi

we are trying to lookup a value in another non related table. In essence similar to a dlookup in access. Is there an equivalent in crystal

Trainingjason
 
No, there is no such function in Crystal.

However, you can implement this by inserting a subreport (listing the values in the lookup table) in the report header. In the detail section of the subreport load the Key and Lookup values into shared variable arrays (can also be done with a single array).

In the report itself, create a formula that looks up a key in the shared variable array and returns the matching lookup value.

Sounds complex, but it's actually quite simple... :eek:)

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top