I wish to run reports for customers that will show stock levels as a written text for website postings.
I wish to show stock levels over 3 as 'YES' and below 3 as 'NO'
I have done this in an SSMS query with a declare statement and union to join the results but this does not work in the alerts program Orbis.
My investigations reveal it is the declare statement.
Please can someone advise the best way to correct this.
Note: my sql is getting better but is still very basic.
I have attached the top half of the code
DECLARE @av_yes varchar(5)
SET @av_yes = 'YES'
select stkcode,stkname,stk_usrchar1,stk_sort_key,stk_sort_key1,stk_sort_key2,stk_sort_key3,@av_yes as available
from stk_stock left outer join stk_stock3 on stkcode = stkcode3
where stk_physical > 3