Print Page | Close Window

Link String & Numeric Data Types

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=18119
Printed Date: 04 May 2024 at 4:59am


Topic: Link String & Numeric Data Types
Posted By: lkldcrys
Subject: Link String & Numeric Data Types
Date 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



Replies:
Posted By: comatt1
Date 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.



Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window