Solved

Crystal Reports - Query within formula

Posted on 2009-05-13
3
267 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now