hi,
i get
incorrect syntax near 'then'
when i use this code:
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 use this code:
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