Ir al contenido principal

T-SQL CASE

select
CASE Month(fecha)
WHEN 1 THEN Year(fecha)-1
ELSE Year(fecha)
END as [FY], tipoproducto, tecnico
from Fconsultatec where fecha is not null

Comentarios

Entradas populares de este blog

Word campos combinados formato numero

cuando combinamos correspondencia con un Excel el importe puede darnos con muchos decimal, formato campo combiando: { MERGEFIELD total \# "0.000,00" } Porcentaje { ={ MERGEFIELD importe } * 100 \# "0%"} fuente: http://www.gmayor.com/formatting_word_fields.htm

validar dni

bool validarDNI( string dni) { if ( new Regex(" [0-9]{8}[A-Za-z] ").Match(dni).Success) { return (" TRWAGMYFPDXBNJZSQVHLCKE "[( int ) long .Parse(dni.Substring(0, 8)) % 23].ToString() == dni .ToString().ToUpper()); } else { return false ; } } fuente: http://weblogs.asp.net/aspnet-es-blogs/archive/tags/Trucos/ASP.NET/default.aspx