Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Changing SQL Expressions Post Reply Post New Topic
Author Message
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Topic: Changing SQL Expressions
    Posted: 18 Feb 2011 at 3:27am

I have a report which uses an SQL Expression to determine a value related  to an Involvement. Nowadays, I tend to write my reports with Commands from the start, so slotting in a subquery is no problem. But this one was built with tables.

The SQL Expression is

(SELECT vv.UDF_VALUE 
FROM   VIEW_UDF_ENTITY_VALUE vv INNER JOIN UDF_ENTITYTYPE_LINK ulnk
ON vv.UDF_ENTITY_LINK_ID=ulnk.UDF_ENTITY_LINK_ID
 INNER JOIN UDF_DEFINITION udef ON ulnk.UDF_ID=udef.UDF_ID
 WHERE  udef.UDF_ID=10250  and vv.ENTITY_ID="INVOLVEMENT"."INVOLVEMENT_ID")

which worked fine.  Then I got informed there was a lookup table and I needed to show the description instead of the value. So I changed it to

 (SELECT lk.description
FROM   VIEW_UDF_ENTITY_VALUE vv INNER JOIN UDF_ENTITYTYPE_LINK ulnk
ON vv.UDF_ENTITY_LINK_ID=ulnk.UDF_ENTITY_LINK_ID
 INNER JOIN UDF_DEFINITION udef ON ulnk.UDF_ID=udef.UDF_ID
left outer join udf_lookups lk on vv.udf_value = lk.int_code
 WHERE  udef.UDF_ID=10250  and vv.ENTITY_ID="INVOLVEMENT"."INVOLVEMENT_ID")

And now it fails saying "INVOLVEMENT"."INVOLVEMENT_ID" is not a valid expression.
I think this is to do with the way crystal parses SQL expressions. Once in there, always in there, even  if deleted. I have tried all sorts of ways to get it to accept it, but no go.
Any suggestions, short of rebuilding the report? Which, in frustration, I have done in the past.  But this one is a bit big.

Thanks
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.031 seconds.