hi guys
I have a user defined sql function in my sql server db called TenPercentDisco unt but not sure how to call it within sql statement?
I'm ideally looking for my function to be applied to a select * sql statement similar to my amateur attempt below
iv tried both
"SELECT * FROM TenPercentDisco unt(RMT_2DayTou rs) WHERE ID IN (1,2,3)"
"SELECT TenPercentDisco unt, * FROM RMT_2DayTours WHERE ID IN (1,2,3)"
but not having any joy? my function code is
please advise
omar
I have a user defined sql function in my sql server db called TenPercentDisco unt but not sure how to call it within sql statement?
I'm ideally looking for my function to be applied to a select * sql statement similar to my amateur attempt below
iv tried both
"SELECT * FROM TenPercentDisco unt(RMT_2DayTou rs) WHERE ID IN (1,2,3)"
"SELECT TenPercentDisco unt, * FROM RMT_2DayTours WHERE ID IN (1,2,3)"
but not having any joy? my function code is
Code:
CREATE FUNCTION TenPercentDiscount (@InputVals int) RETURNS int AS BEGIN declare @convertedVal varchar(30) set @convertedVal = Cast(@InputVals * 0.9 as int) return @convertedVal end
omar
Comment