PDC_REPORT_CreazioneDB/sql/storedCollaudo/dbo_SO_getNewSubscriptions.sql
2025-06-06 19:02:52 +02:00

28 lines
552 B
Transact-SQL

-- Schema: dbo
-- Stored Procedure: SO_getNewSubscriptions
CREATE procedure [dbo].[SO_getNewSubscriptions]
@ultimaDataRilevata_ISODATE as varchar(8)
AS
BEGIN
DECLARE @the_date datetime
SET @the_date = CAST(@ultimaDataRilevata_ISODATE AS DATETIME)
SELECT
[Cod_Fiscale],
[CodiceContratto],
[Cod_Agente],
[Rete],
dbo.ToShortDateString([Data_Perf]) as data_perfezionamento_C6,
dbo.ToShortDateString([data_fineAvanzato] )as data_chiusura_C6
FROM [C6Mart].[CONTRATTOSEI]
WHERE Data_Perf > @the_date
ORDER BY data_perf
END