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)
