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, ,>
-- =============================================
--select dbo.PeriodoPrimerMes()
CREATE OR ALTER FUNCTION dbo.PeriodoPrimerMes
(
-- Add the parameters for the function here
)
RETURNS INT
AS
BEGIN
RETURN CONVERT(INT,CONVERT(CHAR(4),YEAR(getdate())) + '01')
END
GO
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
--select dbo.PeriodoPrimerMes()
CREATE OR ALTER FUNCTION dbo.PeriodoPrimerMes
(
-- Add the parameters for the function here
)
RETURNS INT
AS
BEGIN
RETURN CONVERT(INT,CONVERT(CHAR(4),YEAR(getdate())) + '01')
END
GO