Solved

Crystal Reports - Query within formula

Posted on 2009-05-13
3
272 Views
Last Modified: 2012-05-06
Hello,

I have a report that has two tables that are linked together by the code field.  There are instances where I want to display a field in table2 based on a different link.  For example table1 and table2 are linked by table1.code and table2.code.  I am displaying the table2.desc field.  There are times when i want to display the table2.desc field where table1.differentcode is equal to table2.code.

I thought perhaps I could put a query inside a formula, something like:

Description = SQL_Query("select table2.desc from table2, table1 where table1.differentcode = table2.code");

This is just an example to explain what I am looking for - any suggestions?
0
Comment
Question by:AncientFrib
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 24375621
Crystal does have SQL Expressions that cann be used in formulas.  I haven't used them but if you look at the HELP on them you should be able to figure it out.

mlmcc
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 24375634
One thing the SQL Expression can only return 1 record so if it might return more than one you have to further filter the data so you get only 1 record.

mlmcc
0
 
LVL 5

Author Closing Comment

by:AncientFrib
ID: 31581013
That worked, thanks!
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question