Joined: 16 Jul 2008
Location: United States
Online Status: Offline
Posts: 1
Topic: Mimic MSSQL Statement in Crystal XI Posted: 16 Jul 2008 at 12:42pm
I am able to create the recordset I need in MSSQL using the following statement: ------------------------------------------------------ SELECT CounterJobTaskDetail.JobItem, CounterJobTaskDetail.TaskCode, EstimBinderySpoils.ActivitySpoiPercent, EstimBinderySpoils.ActivityMRSpoils, CounterJobTaskDetail.CJobNumber FROM CounterJobTaskDetail,EstimBinderySpoils WHERE CASE when CHARINDEX('X',CounterJobTaskDetail.TaskCode) > 0 then LEFT(CounterJobTaskDetail.TaskCode,CHARINDEX('X',CounterJobTaskDetail.TaskCode) - 1) else CounterJobTaskDetail.TaskCode end = EstimBinderySpoils.ActivityMiscKey AND CounterJobTaskDetail.CJobNumber = '138251'; ------------------------------------------------------------
How can I cause Crystal to use a statement like this? Please notice the CASE statement in the WHERE clause.
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 23 Jul 2008 at 1:25pm
In order to use the Case statement, you'll have to use a Command in your report instead of the tables. A Command allows you to enter your own SQL. If any of the values in the where clause come from parameters, replace them in your SQL using the Crystal {?ParameterName} syntax.
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