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

Select "All Records"

Status
Not open for further replies.

skibear99

Instructor
Dec 29, 2003
3
US
We are using Sybase version 9.02 (I believe, as that's the version of Interactive SQL we have)

This is in conjunction with Open Reports as our reporting tool.

What I'm trying to do is give the end-user an option to select All Records of a given type from the front-end.

The code being used for this line is:
if Param_Value ='ALL' then cust_id>'
else cust_id=Param_Value

I get an error message of: "Syntax error near '>'

If I try this Case Statement:
case when Param_Value ='ALL' then length(cust_id)>=2
else cust_id=Param_Value end

I get a similar error message.

Any assistance, apart from recommending Crystal Reports (believe me, I've tried!) is greatly appreciated.
 
You are mixing char and int data types
I don't know SQL Anywhere but maybe this code might push you in the right direction
Code:
declare @i int

select @i=5
select number from master..spt_values
where type='P'
  and number=case when @i is null then number else @i end

select @i=null
select number from master..spt_values
where type='P'
  and number=case when @i is null then number else @i end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top