Win has asked for the wisdom of the Perl Monks concerning the following question:
DECLARE @number_of_years AS NVARCHAR(2) if @Method LIKE 'RSD_____%' or @Method LIKE 'RMS_______%' begin SET @number_of_years = (@yearto-@yearfrom)+1 end if @Method LIKE 'RSD_t%' begin if (SELECT SUBSTRING(@Method, 21, 1)) = '0' begin SET @number_of_years = (SELECT SUBSTRING(@Method, 22, 1)) end else begin SET @number_of_years = (SELECT SUBSTRING(@Method, 21, 2)) end end CAST (@number_of_years AS INT)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Datatypes. A Perl T-SQL comparison
by demerphq (Chancellor) on Nov 16, 2005 at 14:46 UTC | |
|
Re: Datatypes. A Perl T-SQL comparison
by mpeppler (Vicar) on Nov 16, 2005 at 16:37 UTC | |
|
Re: Datatypes. A Perl T-SQL comparison
by Perl Mouse (Chaplain) on Nov 16, 2005 at 15:20 UTC | |
|
Re: Datatypes. A Perl T-SQL comparison
by thor (Priest) on Nov 16, 2005 at 14:24 UTC | |
| |
|
Re: Datatypes. A Perl T-SQL comparison
by jfroebe (Parson) on Nov 16, 2005 at 16:15 UTC |