Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Record Selection criteria from a multiple entry parameter

Status
Not open for further replies.

koz

Programmer
Jan 12, 2000
31
US
I'm using Crystal 8.5.

Below are 2 examples.

I have been trying to make #2 work:

Example #1

Report/Record Select Window
---------------------------
// ?TicketNos=74759


{Incident.Incident #} = {?TicketNos}
and
{Incident.First Name} = "Automated"
and
{Incident.Group Name} = "HELP DESK"

-----------------------------------------------------------

SQL Query
---------
SELECT
Incident."Incident #", Incident."Open Date & Time", Incident."Close Date & Time", Incident."Incident Description", Incident."Incident Resolution", Incident."Group Name", Incident."First Name", Incident."Full Name Assigned To", Incident."Subject ID", Incident."Subject Description"
FROM
"MagicTSD"."_SMDBA_"."Incident" Incident
WHERE
Incident."Incident #" = 74759 AND
Incident."First Name" = 'Automated' AND
Incident."Group Name" = 'HELP DESK'
ORDER BY
Incident."Incident #" ASC

**********************************************************************************************************************

Example #2


Report/Record Select Window
---------------------------
NumberVar i;


For i := 1 to ubound({?TicketNos})
Do ({Incident.Incident #} = {?TicketNos};)

and
{Incident.First Name} = "Automated"
and
{Incident.Group Name} = "HELP DESK"

-----------------------------------------------------------

SQL Query
---------
SELECT
Incident."Incident #", Incident."Open Date & Time", Incident."Close Date & Time", Incident."Incident Description", Incident."Incident Resolution", Incident."Group Name", Incident."First Name", Incident."Full Name Assigned To", Incident."Subject ID", Incident."Subject Description"
FROM
"MagicTSD"."_SMDBA_"."Incident" Incident
ORDER BY
Incident."Incident #" ASC

###########################################################

I was wondering why I didn't get a WHERE clause with the 2nd example.

I'd like to pass a variable number of values in the parameter.
 
You can do this without doing looping logic. Simply use

{Incident.Incident #} = {?TicketNos}

as your selection formula and make {?TicketNos} a multi-value parameter. CR can't convert the Looping logic to a selection formula.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- TEK2(AT)kenhamady.com
 
Thanks for your help. I guess I was trying to make it too complicated for my own good.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top