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

ALL Parameter, error "A number is required here" 1

Status
Not open for further replies.

hallux

Programmer
Feb 25, 2003
133
US
Hi everybody,
I setup a parameter with "ALL" as default and can't get it to work correctly. I would like the report to select either 1 or all invoices.

Selection Expert:
{INVOICE.INVOICENUM} = (if {?Invoice#} <> &quot;ALL&quot; then {?Invoice#})

Gives error &quot;A number is required here&quot;

I would like it to do server-side processing, any help will be appreciated.
-Brent
 
Selection Expert:

(
if {?Invoice#} <> &quot;ALL&quot; then
{INVOICE.INVOICENUM} = {?Invoice#})
else if {?Invoice#} = &quot;ALL&quot; then
true
)

The error you're receiveing sounds like ?Invoice is a number type parm, not text, if that's the case, change it to a text type, and convert it in the formula to a number for comparison with the database in the invoicenum field is a numeric.

-k
 
Thank you.
I converted to string by setting the ?Invoice parameter up as type string. Then I could compare the parameter with &quot;ALL&quot;. I then converted ?Invoice tonumber for comparing with the database field invoicenum of type number. Works perfect.

here's how it looks in the report:
(
if {?Invoice#} <> &quot;ALL&quot; then
{INVOICE.INVOICENUM} = tonumber({?Invoice#})
else if {?Invoice#} = &quot;ALL&quot; then
true
)

-Brent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top