Solved

Crystal Reports - Query within formula

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cross tab crystal reports - filter a row 7 56
C# Crystal Reports 15 88
Crystal image Object type? 7 33
Need help with a Crystal Report in my C#.Net application 2 12
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 …
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

813 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