Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Null on Null Input | False |
| Schema Bound | False |
| Assembly |
Parameters
1| Name | Data Type | Length | Description |
|---|---|---|---|
| (Result) | int | 4 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
CREATE OR ALTER FUNCTION dbo.PeriodoAdelantado
(
-- Add the parameters for the function here
)
RETURNS INT
AS
BEGIN
-- Return the result of the function
RETURN CONVERT(INT, CONVERT(VARCHAR(4),YEAR(GETDATE())) + RIGHT('00' + CONVERT(VARCHAR(2),MONTH(GETDATE())), 2))
END
GO
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
CREATE OR ALTER FUNCTION dbo.PeriodoAdelantado
(
-- Add the parameters for the function here
)
RETURNS INT
AS
BEGIN
-- Return the result of the function
RETURN CONVERT(INT, CONVERT(VARCHAR(4),YEAR(GETDATE())) + RIGHT('00' + CONVERT(VARCHAR(2),MONTH(GETDATE())), 2))
END
GO