Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Technical Questions
Topic: formula to retrieve values from 2 different table
Author
Message
patapatty
Newbie
Joined: 21 Sep 2011
Location: Italy
Online Status: Offline
Posts: 3
Topic: formula to retrieve values from 2 different table
Posted: 21 Sep 2011 at 10:34pm
I have this
problem.
In a table that
I put
in a report
I have 2
fields
:
LinkType
and Code
Depending on the
content of
LinkType
, the report
would like to see
a description that
must
be retrieved
from several tables
using
value
as a
code
.
Here's an example
:
LinkType
= 1 and Code = 15
LinkType
= 2 and Code = 15
In the first case
I would like to
see the
description
on the
code 15
taken from
Table 1
.
In the second case
I would like to
see the
description
on the
code 15
taken from
Table2
.
Is there
a function to
do this (
I was thinking of
a kind
used
as
DLookup
in Access
)
or is it better
if
I prepare the
data in a
temporary table (using my VB project )and
I base
the report
on the latter
?
thanks
Edited by patapatty - 21 Sep 2011 at 11:01pm
IP Logged
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 22 Sep 2011 at 3:35am
since the tables are available to the reports, or they should be, you could write a formula like:
if {tablex.LinkType} = 1 then
{table1.Description};
if {tablex.LinkType} = 2 then
{table2.Description};
you would want to link your lookup tables to the main table using a outer join to the main table based on the code for this formula to work.
HTH
IP Logged
patapatty
Newbie
Joined: 21 Sep 2011
Location: Italy
Online Status: Offline
Posts: 3
Posted: 28 Sep 2011 at 11:27pm
Thank's a lot.
Patrizia
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
delete your posts in this forum
You
cannot
edit your posts in this forum
You
cannot
create polls in this forum
You
cannot
vote in polls in this forum
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
BAEZL
© 2004-2026 Brian Bischof. All Rights Reserved.