CASE (URGENTE) sigue sin funcionar
Publicado por kontxi (47 intervenciones) el 30/03/2001 15:23:55
Creo q antes no lo he explicado bien, mi problema es el siguiente. Tengo q hacer segun unos kg haya unas tarifas y me gustaría (si se puede), hacerlo con un CASE.Con el if seria así.
if kilos >=1 and kilos<=10 then
tarifa=1
elseif kilos>10 and kilos<=20 then
tarifa=2
elseif kilos>20 and kilos<=30 then
tarifa=3
end if
Así no se queda ningun kilo sin tarifa.
con el case de momento lo he hecho así:
select case kilos
case 1 to 10
tarifa=1
case 10.1 to 20
tarifa=2
case 20.1 to 30
tarifa=3
end case
pero el problema es que así si kilos=20.01, no entraría en ningún intervalo.
MUCHAS GRACIAS POR ANTICIPADO.SALUDOS
if kilos >=1 and kilos<=10 then
tarifa=1
elseif kilos>10 and kilos<=20 then
tarifa=2
elseif kilos>20 and kilos<=30 then
tarifa=3
end if
Así no se queda ningun kilo sin tarifa.
con el case de momento lo he hecho así:
select case kilos
case 1 to 10
tarifa=1
case 10.1 to 20
tarifa=2
case 20.1 to 30
tarifa=3
end case
pero el problema es que así si kilos=20.01, no entraría en ningún intervalo.
MUCHAS GRACIAS POR ANTICIPADO.SALUDOS
Valora esta pregunta


0