on 08-12-2014 5:24 PM
Hola a todos,
Quisiera validar que los campos numericos de SN tengan datos correctos,
por ejemplo telefono (que no sea posible capturarle letras) y asi mismo delimitar el numero de caracteres lada+ numero (33)(36158031) p.e.
y el campo de Nombre y Nombre Comercial que no puedan agregarle numeros solo letras y caracteres especiales
Gracias a todos
Hola,
Este codigo te funciona para validar solo letras. Si hay un numero retorna 1
Declare @Valor varchar(10)
Declare @i int
Declare @Resultado bit
Set @Valor = 'faff'
Set @i = 1
Set @Resultado = 0
while @i <= len(@valor) and @Resultado = 0
begin
if isnumeric(substring(@Valor,@i,1)) = 1
Set @Resultado = 1
Set @i = @i + 1
end
select @Resultado
Siendo el resultado 0 cuando solo tiene letras, y 1 cuando tiene al menos 1 numero.
Y con este cambio retorna 0 cuando solo tiene numeros y 1 cuando hay alguna letra
Declare @Valor varchar(10)
Declare @i int
Declare @Resultado bit
Set @Valor = 'faff'
Set @i = 1
Set @Resultado = 0
while @i <= len(@valor) and @Resultado = 0
begin
if isnumeric(substring(@Valor,@i,1)) = 0
Set @Resultado = 1
Set @i = @i + 1
end
select @Resultado
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alejandro
HOLA QUISIERA QUE PARA TODO SOCIO DE NEGOCIO EN AUTOMATICO SIEMPRE SOLO TOMARA TODAS LAS MONEDAS.Y NO SE HABILITARA LA OPCION DE ELEGIR UNA.
ASI MISMO QUISIERA VALIDAR QUE EN EL GRUPO DE SOCIO DE NEGOCIOS APAREZCA UNOSIEMPRE POR DAFAULT PARA OBLIGAR AL USUARIO A QUE ELIGA UNO
P.E. VOY A CREAR LA CATEGORIA " A DEFINIR" PARA QUE POR ORDEN APAREZCA PRIMERO Y DESPUES QUE SELECCIONE UNO DIFERENTE DE ESE PARA QUE PUEDA GRABARLO
MIL GRACIAS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.