Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: SQL inside of a formula Post Reply Post New Topic
Author Message
icw001
Newbie
Newbie


Joined: 13 Feb 2012
Online Status: Offline
Posts: 4
Quote icw001 Replybullet Topic: SQL inside of a formula
     Posted: 13 Dec 2012 at 7:34am

Hi,
I need help using SQL inside of a formula.

Here is the scenario:

I have a prompt which allows multiple parameters

The prompt parameter on the report allows users to choose one or more of the following:

fruits
vegetables
Cold beverages
Hot beverages

I would to query the tables corresponding tables to the user selection and see
if my data set has matching data.
Currently I am using a formula :

@if_fruits
dataset.fruit_id in [1, 2,3 ]

I would like to maintan separate tables with definitions of fruits, vegetables, cold beverages, hot beverages and embed sql into the formula to query for matching data. My objective is to accomodate definitional changes over time. I would like just update one table rather than hundreds reports with this prompt.

Thanks for your help.

Ina
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Dec 2012 at 7:40am
you can't use sql anywhere but in the initial data retrieval
 
if you add values to the parameter list due to adding rows into a table, you would need to alter the report to understand how it should handle the new values.
 
Sorry, I doubt that this is the answer that you wanted.
 
If you run your report off of stored procs, you might be able to create a sql function that returns the valid values that you are after and therefore be able to just change the function and have the results permeate out to all the of report procedures.
 
 
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