Print Page | Close Window

IN Formula with Many Parameters

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22655
Printed Date: 02 May 2024 at 10:56pm


Topic: IN Formula with Many Parameters
Posted By: igendreau
Subject: IN Formula with Many Parameters
Date Posted: 08 Aug 2018 at 5:13am
So I was asked to write a report that shows sales within a 50 miles radius. I used a tool on the web to generate the 977 zip codes that are included in that radius. But when I write my formula:

{MyTable.MyField} in {"19508", "19543", "19875"} (except with my 977 zip codes pasted here) I keep getting an error that "The matching " for this string is missing".

I've tried bringing it into notepad, copying and pasting it multiple ways. Is there a limit to how long a list of values like that can be in Crystal? Or is there a better way that I can do this?



Replies:
Posted By: DBlank
Date Posted: 09 Aug 2018 at 9:49am
I am not sure about the length of a specific item like that.
Your sure they are all double quotes and not any single quotes next to each that look like a double quote?
You can also try and break it into parts with an OR between each subpart
(
{MyTable.MyField} in ["19508", "19543", "19875"]
Or
{MyTable.MyField} in ["19509", "19544", "19876"]
OR
{MyTable.MyField} in ["19510", "19545", "19877"]
)

maybe add a table or stored proc as a temp table result of the 977 rows that is the list and just join it to limit?



Print Page | Close Window