FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Como valido un null??
hola... otra vez yo
Les hago una pregunta... resulta que en un query estoy sumando el mismo campo de la siguiente forma (Firebird 1.5)
pero cuando uno de los dos resultados es null necesito tomar este como un 0 y asi al efectuar la operacion tenga resultados positivos o negativos, pero en el momento solo consigo un Null... que debo hacer???? |
#2
|
||||
|
||||
En SQL SERVER puedes hacer lo siguiente:
Código:
select distinct (select sum(ISNULL(a.VALOR,0)) from T_ABONOS a where a.TIPO = 1) - (select sum(ISNULL(a.VALOR,0) from T_ABONOS a where a.TIPO = 2) from T_ABONOS
__________________
Saludos, Peter Investment |
#3
|
|||
|
|||
Gracias por la pista...
listo ya encontre como... no era con 'ISNULL(a.VALOR,0))' pero era la ecencia
si alguien mas le sirve es de la siguiente forma......
y no
|
|
|
|