PDC_REPORT_CreazioneDB/sql/Collaudo/funzioni/C6MartPeriodico_getTrimestreDettMov.sql
2025-06-10 15:29:00 +02:00

20 lines
549 B
Transact-SQL

-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
CREATE FUNCTION [C6MartPeriodico].[getTrimestreDettMov]
(
-- Add the parameters for the function here
)
RETURNS VARCHAR(8)
AS
BEGIN
-- Declare the return variable here
DECLARE @Valore VARCHAR(8)
SELECT @Valore = max(DTTRIM)
FROM [C6StagingPeriodico].[W6APTR]
WHERE DTTRIM not in ('99999999')
-- Return the result of the function
RETURN @Valore
END