Solved

Crystal Reports - Query within formula

Posted on 2009-05-13
3
273 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 101

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 101

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

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 …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

687 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