Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Record Selection In Clause Post Reply Post New Topic
Author Message
bwarneke
Newbie
Newbie


Joined: 03 Dec 2015
Online Status: Offline
Posts: 3
Quote bwarneke Replybullet Topic: Record Selection In Clause
     Posted: 06 Jan 2016 at 4:40am
Hi Everyone,
I'm running into an issue while passing multiple string values as a parameter to be used in the record selection formula. For the most part it works. The issue I have is how CR interprets the string value.

An example is this list of jobs:
556126
555523-2
555917
554711
555916

The report will accept the list and process. But what I'm getting on the report is an additional job number of 555523 even though it has not been entered. It seems that CR is evaluating the job as 'like' rather than just the value.

Any ideas on getting CR to use only the list that has been passed?

Thanks for any help!

Bill
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Jan 2016 at 5:09am
what exactly is your select statement?
IP IP Logged
bwarneke
Newbie
Newbie


Joined: 03 Dec 2015
Online Status: Offline
Posts: 3
Quote bwarneke Replybullet Posted: 06 Jan 2016 at 5:18am
This is the code. JobsParam is comma formatted like this in VB:

['556126','555523-2','555917','554711','555916']


SELECT "PM_Company1"."CompName","PM_Plant1"."PlantName","PV_Job1"."JobCode","PV_Job1"."JobName","PV_Customer1"."CustCode" ,"PV_Customer1"."CustName","PV_Job1"."StatusCode","PV_Job1"."EstCode","PV_JobWIP1"."CompNum","PV_JobWIP1"."PlantCode" ,"PV_JobWIP1"."RunNumber","PV_JobWIP1"."JobCode","PV_JobWIP1"."MatVarValue","PV_JobWIP1"."MRVarValue","PV_JobWIP1"."RunVarValue" ,"PV_JobWIP1"."RouteVarValue","PV_JobWIP1"."RateVarValue","PV_JobWIP1"."AbsVarValue","PV_JobWIP1"."ScrapVarValue" ,"PV_JobWIP1"."CompVarValue","PV_JobWIP1"."CostVarValue","PV_JobWIP1"."WIPValue","PV_Job1"."PlantCode","PV_Job1"."CompNum","PV_Job1"."JobStatus"

FROM {oj(( ( "PUB"."PV_JobWIP" "PV_JobWIP1" LEFT OUTER JOIN "PUB"."PV_Job" "PV_Job1"
ON ( ("PV_JobWIP1"."PlantCode" = "PV_Job1"."PlantCode")
AND ("PV_JobWIP1"."JobCode" = "PV_Job1"."JobCode") )
AND ("PV_JobWIP1"."CompNum" = "PV_Job1"."CompNum") ) LEFT OUTER JOIN "PUB"."PM_Company" "PM_Company1"
ON "PV_Job1"."CompNum" = "PM_Company1"."CompNum" ) LEFT OUTER JOIN "PUB"."PM_Plant" "PM_Plant1"
ON ("PV_Job1"."PlantCode" = "PM_Plant1"."PlantCode")
AND ("PV_Job1"."CompNum" = "PM_Plant1"."CompNum")) LEFT OUTER JOIN "PUB"."PV_Customer" "PV_Customer1"
ON ("PV_Job1"."CompNum" = "PV_Customer1"."CompNum")
AND ("PV_Job1"."CustCode" = "PV_Customer1"."CustCode") }

WHERE "PV_JobWIP1"."RunNumber" = 130
AND "PV_JobWIP1"."CompNum" = 1
AND "PV_JobWIP1"."PlantCode" = '11'
AND "PV_JobWIP1"."JobCode" IN {?JobsParam}

ORDER BY "PV_Job1"."JobCode"   



Edited by bwarneke - 07 Jan 2016 at 2:44am
IP IP Logged
bwarneke
Newbie
Newbie


Joined: 03 Dec 2015
Online Status: Offline
Posts: 3
Quote bwarneke Replybullet Posted: 07 Jan 2016 at 2:46am
I have a resolution.   I went away from the 'In' clause and instead made a separate line for each job.

AND "PV_JobWIP1"."JobCode" = '556126'
OR "PV_JobWIP1"."JobCode" = '555523-2'

This seemed to be the only way to get the correct data.

Hope this helps someone.

Bill
IP IP Logged
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