Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: For Next Loops Post Reply Post New Topic
Author Message
cbaldwin
Groupie
Groupie


Joined: 09 Apr 2014
Online Status: Offline
Posts: 81
Quote cbaldwin Replybullet Topic: For Next Loops
    Posted: 07 Jan 2020 at 3:52am
I understand the general concept of For Next Loops, I just have no idea how to execute them on a Command table in Crystal. Is there a good basic resource to build my knowledge on this subject.

My present problem is that i have a parameter with multiple values. I would like to use the code below and loop through each of the values in my parameter to have them be equal to the equipment_id ('D40110' AS equipment_id). My goal is to generate a complete set of dates associated with each parameter value(equipment_id) for graphing purposes. This is to avoid having missing dates on the x-axis for each equipment_id. Any thoughts are greatly appreciated.

For the sake of discussion the parameter of multiple equipment ids is called {?equip_list}


SELECT

TRUNC(cia.activity_datetime) as dt,
'D40110' AS equipment_id,

FROM COMPONENT_INV_ACTIVITY cia

WHERE
cia.activity_datetime>={?START_DRAW_DATE} AND
cia.activity_datetime<{?END_DRAW_DATE}+1

GROUP BY

TRUNC(cia.activity_datetime)
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 23 Jan 2020 at 10:41am
You can't do this in a For Next loop in the report. Based on the query you posted, it looks like you're using Oracle. I'm also going to assume that this query is a Command in the report.

To use a multi-select parameter in a Command, you'll do something like this:


and cia.equipment_id in {?Equipment ID}


If you need to make this parameter dynamic, see this blog post: https://blogs.sap.com/2015/04/01/best-practices-when-using-commands-with-crystal-reports/

-Dell
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.