Skip to Content
avatar image
Former Member

Table joins in crystal report

I have imported two tables into crystal report and I know how to link the tables based on the columns. But I have a column in table 1 whose size is 4 and in another table whose size is 2.

Ex:

Table1:

Column

0101

0102

0103

0201

0202

0203

Table2:

Column

01

02

03

04

while linking these tables how can i take sub string of table1 column. Do i need to use SQL expression after linking the tables? if yes how can i map the SQL expression to the field.

Please suggest

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 31, 2014 at 09:17 AM

    Hi Aravind,

    You cannot do this from the default linking options available within CR.

    You would be better off creating a SQL Query that has everything you need including Joins to all the tables and then report off of this query via the 'Add Command' option.

    Other workaround (although not recommended) is to use a Subreport pointing to one of those two tables. The Main Report, let's say, points to Table A (size 4) whereas Subreport points to Table B (size 2). You would then need to create a formula inside the Main Report that strips off two characters from the left and then links to the field from the Subreport. This will considerable slow down the report though.

    You should choose the SQL Query way.

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded