hi,
I get:
Incorrect syntax near 'then'
when i run the following:
Alter Procedure intranet_property_list
@orderby1 varchar(20),
@orderby1_direction varchar(4),
@orderby2 varchar(20),
@orderby2_direction varchar(4)
As
declare @sql varchar(100)
if @orderby1=@orderby2 then @sql="test"
select ref,county,estate_agent,short_description,price_punt,feature,no_bedrooms,category,address1
from properties
order by ref desc
return
I get:
Incorrect syntax near 'then'
when i run the following:
Alter Procedure intranet_property_list
@orderby1 varchar(20),
@orderby1_direction varchar(4),
@orderby2 varchar(20),
@orderby2_direction varchar(4)
As
declare @sql varchar(100)
if @orderby1=@orderby2 then @sql="test"
select ref,county,estate_agent,short_description,price_punt,feature,no_bedrooms,category,address1
from properties
order by ref desc
return