Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Link String & Numeric Data Types Post Reply Post New Topic
Author Message
lkldcrys
Newbie
Newbie


Joined: 03 Dec 2012
Location: United States
Online Status: Offline
Posts: 1
Quote lkldcrys Replybullet Topic: Link String & Numeric Data Types
    Posted: 03 Dec 2012 at 5:48am
Trying to link tables from two databases; data to be linked is string in one DB table, numeric in the other DB table.  I do not have access to change the data type in either database.
 
Is there anyway to create a link in CR 2008?  Thanks!Confused


Edited by lkldcrys - 03 Dec 2012 at 5:48am
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 03 Dec 2012 at 5:51am
probably easiest within a command

in the sql join

on

db1.field1 = cast(db2.field1 as varchar(20)) --- use the same # of chars as the original db.

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 03 Dec 2012 at 5:53am
There is no easy way to do this directly in Crystal.  However, if you can create in one database a link to the other database, you have a couple of options:
 
1.  Create view that supplies the data from both databases in a single "table" in your report.  Connect to one database and use the link to get the data from the other one.
 
2.  In Crystal, connect to one database then create a Command in the report that uses the link to get the data from both in a single select.
 
Using either method, you can convert either the number to text or the text to a number in order to link the data.
 
-Dell
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 03 Dec 2012 at 6:03am
comatt1's suggestion cannot be done in the Select Expert as the Select Expert is looking for Crystal syntax - you would have to create a SQL Expression to be able to it and then it may or may not work.
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.035 seconds.