Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
3| Name | Data Type | Length | Description |
|---|---|---|---|
| @cliente | int | 4 | |
| @fecha_desde | date | 3 | |
| @fecha_hasta | date | 3 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
/*
exec [obtener_novedades_cliente_fecha] 1299789112,'2021-04-26','2021-05-01'
*/
CREATE OR ALTER PROCEDURE dbo.obtener_novedades_cliente_fecha
@cliente int,
@fecha_desde date,
@fecha_hasta date
AS
BEGIN
SET NOCOUNT ON;
select distinct cuit, lower(tipo_novedad) as seccion, lower(tabla) as tabla, id_tabla as id, nro_cheque, fecha
from monitoreos_resultados
where novedad = 1
and id_tabla IS NOT NULL
and convert(date, fecha) between @fecha_desde and @fecha_hasta
and cuit in (select cuit from monitoreos where cliente = @cliente)
--and LOWER(tabla) = 'juicios'
and tabla != 'cendeu_temp'
order by lower(tabla) desc, fecha, cuit
END
GO
GO
/*
exec [obtener_novedades_cliente_fecha] 1299789112,'2021-04-26','2021-05-01'
*/
CREATE OR ALTER PROCEDURE dbo.obtener_novedades_cliente_fecha
@cliente int,
@fecha_desde date,
@fecha_hasta date
AS
BEGIN
SET NOCOUNT ON;
select distinct cuit, lower(tipo_novedad) as seccion, lower(tabla) as tabla, id_tabla as id, nro_cheque, fecha
from monitoreos_resultados
where novedad = 1
and id_tabla IS NOT NULL
and convert(date, fecha) between @fecha_desde and @fecha_hasta
and cuit in (select cuit from monitoreos where cliente = @cliente)
--and LOWER(tabla) = 'juicios'
and tabla != 'cendeu_temp'
order by lower(tabla) desc, fecha, cuit
END
GO
Depends On
2Used By
No items found