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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter and Selection Criteria

Status
Not open for further replies.

bubu2006

MIS
May 2, 2006
157
US
Hi,

I am having trouble with Crystal report. I am using Crystal 10 and Oracle10.2. I have a report which is running fine for last one year. Today that report failed. I have a parameter in this report which is Param1. I am using following code in my selection criteria.

(Table1.Col1}[1 to 3]=Trim({?Param1})
or {?Param1}=" "
or isnull({?Param1})
or {?Param1}="ALL")

Now if I click show SQL query in Crystal report that is
returning
Select Col1,Col2,.....
..........
From Table1
where Table.con1>=1. (I am passing 1 as parameter value).
Thanks,
Ratna
 
Doesn't make sense...

(Table1.Col1}[1 to 3]=Trim({?Param1})
or {?Param1}=" "
or isnull({?Param1})
or {?Param1}="ALL")

The exampel where clause is showing a different column name, is that the problem, you're nopt getting the SQL passed, or?

I'd rewrite it to:

(
if not(isnull({?Param1})
and
trim({?Param1}) <>""
and
{?Param1} <> "ALL" then
(Table1.Col1}[1 to 3]=Trim({?Param1}[1 to 3])
else if isnull({?Param1})
or
trim({?Param1}) = ""
or
{?Param1} = "ALL" then
true
)

-k
 
Where clause is showing same column name. The problem is the condition, I have "=" this sign and it's showing ">=". Is it a Crystal Bug?
 
I only want to get data for user input value. Because in where clause I have Table.col1>=1 the query is trying to return more than one record.
 
Reread your post, and please put some effort into your post:

(Table1.Col1}[1 to 3]=Trim({?Param1})

does not equal:

where Table.con1>=1. (I am passing 1 as parameter value).

one says col1, the other says con1

Did you try my formula?

-k
 
Hi,
(Table1.Col1}[1 to 3]=Trim({?Param1})
or {?Param1}=" "
or isnull({?Param1})
or {?Param1}="ALL")
Is probably not doing what you expect - try ( similar to what Synapse posted):
Code:
If IsNull({?Param1}) or Trim({?Param1}) = "" then
True
Else
(Table1.Col1}[1 to 3]=Trim({?Param1})

Crystal will check for NULL first and, if NULL, stop proceessing the criteria..





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
synapsevampire ,
Yes, I have tried your code. But I still have issue with where clause. Even the report is running fine for few values but not for all.

Turkbear,

I have tried your code also. But there is no change in where clause.

Any clue?
 
Hi,
There is no way that my code ( or Synapse's ) can
result in the where clause having a >=
operator....Crystal does not invent methods...

Using my code, please cut-and-paste the exact Sql generated by Crystal ( and also your Record selection criteria) to avoid typing so much...

Thanks..








[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,
So you do not want to post your actual code?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top