Mensaje enviado por "Ariel Fernando Alvarez" <afatronik@yahoo.com> el 14/03/2002
Sql Server 7.0
if isnull(@inttotal)
return 0
else
return @inttotal
Version SQL 6.5
if @inttotal is null
return 0
else
return @inttotal
Salu2 Cordiales
----- Original Message -----
From: Demian Sclausero
To: demian_a@yahoo.com
Sent: Thursday, March 14, 2002 3:31 PM
Subject: (VB-ESP) store procedure RAro
Hola a todos
perdon por molestar, tengo este strore que tiene que devolverme el total
de ventas de un operador pero me devuelve null auqne le digo que si es null devuelva 0
que puede ser???
Alter Procedure sp_total_de_ventas_de_un_op
(@intOpera [int],
@desde [nvarchar](10),
@hasta [nvarchar](10),
@inttotal [int]output)
As
declare @fdesde [datetime]
declare @fhasta [datetime]
set @fdesde = CONVERT(datetime,@desde,103)
set @fhasta = CONVERT(datetime,@hasta,103)
SELECT @inttotal=SUM(datos_alternos.id_tipo_plan)
FROM arnet INNER JOIN
estados ON
arnet.id_estados = estados.id_estados INNER JOIN
datos_alternos ON
arnet.TELEFONO = datos_alternos.telefono
WHERE vendido = 1 AND rechazado = 0 AND llamar_luego = 0 AND
pend_na = 0 AND registrado = 1 AND enviado_dealer = 0 and id_operador =
@intOpera
and fecha_modificacion between @fdesde and @fhasta
if @inttotal = null
return 0
else
return @inttotal
Desde ya muchas gracias!!!!!!!!