[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Crystal Reports - Query within formula

Posted on 2009-05-13
3
Medium Priority
?
275 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

656 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