Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: SQL Expression returns too many records Post Reply Post New Topic
Author Message
pairsj
Newbie
Newbie


Joined: 08 Sep 2008
Location: United States
Online Status: Offline
Posts: 1
Quote pairsj Replybullet Topic: SQL Expression returns too many records
    Posted: 08 Sep 2008 at 8:24am

Good day,

 Hopefully someone can help me out. I am trying to display the value of a field in one table as a caption in the report header. This  caption is above a ‘description’ field in the details section. When I run my report, I get  the description field displaying 832 times; which is the number of rows found in my caption table. Here is the structure of the two tables:

Table 1: Code, Description

Table 2: Table, Name, Field Name, Caption

Here are the SQL Expressions that I have tried:

(SELECT Caption FROM Table2

    WHERE Table2.FieldName='Description'

          AND Table2.TableName='Code')

(SELECT DISTINCT Caption FROM Table2

    WHERE Table2.FieldName='Description'

          AND Table2.TableName='Code')

And

(SELECT TOP 1 Caption FROM Table2

    WHERE Table2.FieldName='Description'

          AND Table2.TableName='Code')

If I run these directly in my Db, I get correct results. If in Crystal, incorrect results. I have tried the following suppress on the Details: Table1.Code= previous (Table1.Code) which works UNLESS I have any summaries. Once I include a summary, my total ALWAYS factors in the suppressed, duplicate records.

Any ideas?
Thanks

Pairsj
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.016 seconds.