SET @InvoiceNo='Final/' + (CASE WHEN @month <= 3 THEN CAST((@year-1) AS VARCHAR) ELSE CAST(@year AS VARCHAR) END) +'-' + (CASE WHEN @month <= 3 THEN CAST(((@year)%2000) AS VARCHAR) ELSE CAST(((@year+1)%2000) AS VARCHAR) END)+'/'+ CONVERT(VARCHAR(10),@CurrentNo) print @InvoiceNo
how to get invoice number
select @InvoiceNo as InvoiceNo, othefield FROM sometable
select @InvoiceNo as InvoiceNo
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)