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

Parameter value for a NEGATIVE number...?

Status
Not open for further replies.

MJRBIM

MIS
May 30, 2003
1,579
CA
CR-XI (R2)
MS-SQL DB
===========

Looking to create a parameter value for a NUMBER field where the parameter can be a negative number.

The runtime prompt for the field says -
"Please specify a Number value greater than or equal to 0"

How can I set-up a parameter value for a NUMBER field where the parameter can be a NEGATIVE number....?

Thanks in Advance for the help.
 
YOu can use crystal function abs(). This returns positive value.

Abs({Numberfield}) = {?Paramter}

Ian
 
If you need to preserve the negative, you could set up the parameter as a string parameter, and then use a record selection formula like:

totext({table.number},0,"") = {?parm}

Or even better, convert it to a string in a SQL expression. The function/punctuation you would use depends upon your datasource, but you could try:

to_char({"table"."number"})

Or,

{fn convert(`table`.`number`,sql_varchar)}

Then you would use the SQL expression set to the parm in the record selection formula, which would then pass to the SQL.

-LB
 
breed wrote:
"You probably have a 0 value in the parameter Min Value property.
Edit the parameter, then scroll down to the bottom of the Value Options grid and look for "Min Value". In the column to the right, is there a value there? I suspect it is a 0. Go ahead and delete it and rerun the report."


That was it...I just didn't scroll-down far enough....

THANKS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top