cancel
Showing results for 
Search instead for 
Did you mean: 

Validacion numeros en Socios de Negocios

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member413321
Contributor
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

former_member413321
Contributor
0 Kudos

Hola, en ese caso debes hacer la busqueda formateada para que retorne el valor de seleccion.

Por ejemplo en la moneda, haces el select 'USD', de esta manera el marcará la moneda dolares al invocar la busqueda formateada.