SqlFunctions.DateDiff Método

Definición

Devuelve el número de límites de fecha y hora entre dos fechas especificadas.

Sobrecargas

DateDiff(String, String, String)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, String, Nullable<TimeSpan>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, String, Nullable<DateTimeOffset>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, String, Nullable<DateTime>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, Nullable<TimeSpan>, String)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, Nullable<TimeSpan>, Nullable<TimeSpan>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, Nullable<TimeSpan>, Nullable<DateTimeOffset>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, Nullable<TimeSpan>, Nullable<DateTime>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, Nullable<DateTimeOffset>, Nullable<TimeSpan>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, Nullable<DateTimeOffset>, String)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, Nullable<DateTimeOffset>, Nullable<DateTime>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, Nullable<DateTime>, String)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, Nullable<DateTime>, Nullable<TimeSpan>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, Nullable<DateTime>, Nullable<DateTimeOffset>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

DateDiff(String, Nullable<DateTime>, Nullable<DateTime>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

DateDiff(String, String, String)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, System::String ^ startDate, System::String ^ endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, string startDate, string endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * string * string -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As String, endDate As String) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
String

Primera fecha.

endDate
String

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, String, Nullable<TimeSpan>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, System::String ^ startDate, Nullable<TimeSpan> endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, string startDate, TimeSpan? endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * string * Nullable<TimeSpan> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As String, endDate As Nullable(Of TimeSpan)) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
String

Primera fecha.

endDate
Nullable<TimeSpan>

Segunda fecha.

Devoluciones

Valor que especifica el número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, String, Nullable<DateTimeOffset>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, System::String ^ startDate, Nullable<DateTimeOffset> endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, string startDate, DateTimeOffset? endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * string * Nullable<DateTimeOffset> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As String, endDate As Nullable(Of DateTimeOffset)) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
String

Primera fecha.

endDate
Nullable<DateTimeOffset>

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, String, Nullable<DateTime>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, System::String ^ startDate, Nullable<DateTime> endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, string startDate, DateTime? endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * string * Nullable<DateTime> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As String, endDate As Nullable(Of DateTime)) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
String

Primera fecha.

endDate
Nullable<DateTime>

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, Nullable<TimeSpan>, String)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, Nullable<TimeSpan> startDate, System::String ^ endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, TimeSpan? startDate, string endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * Nullable<TimeSpan> * string -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of TimeSpan), endDate As String) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
Nullable<TimeSpan>

Primera fecha.

endDate
String

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, Nullable<TimeSpan>, Nullable<TimeSpan>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, Nullable<TimeSpan> startDate, Nullable<TimeSpan> endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, TimeSpan? startDate, TimeSpan? endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * Nullable<TimeSpan> * Nullable<TimeSpan> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of TimeSpan), endDate As Nullable(Of TimeSpan)) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
Nullable<TimeSpan>

Primera fecha.

endDate
Nullable<TimeSpan>

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, Nullable<TimeSpan>, Nullable<DateTimeOffset>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, Nullable<TimeSpan> startDate, Nullable<DateTimeOffset> endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, TimeSpan? startDate, DateTimeOffset? endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * Nullable<TimeSpan> * Nullable<DateTimeOffset> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of TimeSpan), endDate As Nullable(Of DateTimeOffset)) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
Nullable<TimeSpan>

Primera fecha.

endDate
Nullable<DateTimeOffset>

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, Nullable<TimeSpan>, Nullable<DateTime>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, Nullable<TimeSpan> startDate, Nullable<DateTime> endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, TimeSpan? startDate, DateTime? endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * Nullable<TimeSpan> * Nullable<DateTime> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of TimeSpan), endDate As Nullable(Of DateTime)) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
Nullable<TimeSpan>

Primera fecha.

endDate
Nullable<DateTime>

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, Nullable<DateTimeOffset> startDate, Nullable<DateTimeOffset> endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, DateTimeOffset? startDate, DateTimeOffset? endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of DateTimeOffset), endDate As Nullable(Of DateTimeOffset)) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
Nullable<DateTimeOffset>

Primera fecha.

endDate
Nullable<DateTimeOffset>

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, Nullable<DateTimeOffset>, Nullable<TimeSpan>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, Nullable<DateTimeOffset> startDate, Nullable<TimeSpan> endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, DateTimeOffset? startDate, TimeSpan? endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * Nullable<DateTimeOffset> * Nullable<TimeSpan> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of DateTimeOffset), endDate As Nullable(Of TimeSpan)) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
Nullable<DateTimeOffset>

Primera fecha.

endDate
Nullable<TimeSpan>

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, Nullable<DateTimeOffset>, String)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, Nullable<DateTimeOffset> startDate, System::String ^ endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, DateTimeOffset? startDate, string endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * Nullable<DateTimeOffset> * string -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of DateTimeOffset), endDate As String) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
Nullable<DateTimeOffset>

Primera fecha.

endDate
String

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, Nullable<DateTimeOffset>, Nullable<DateTime>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, Nullable<DateTimeOffset> startDate, Nullable<DateTime> endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, DateTimeOffset? startDate, DateTime? endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * Nullable<DateTimeOffset> * Nullable<DateTime> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of DateTimeOffset), endDate As Nullable(Of DateTime)) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
Nullable<DateTimeOffset>

Primera fecha.

endDate
Nullable<DateTime>

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, Nullable<DateTime>, String)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, Nullable<DateTime> startDate, System::String ^ endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, DateTime? startDate, string endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * Nullable<DateTime> * string -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of DateTime), endDate As String) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
Nullable<DateTime>

Primera fecha.

endDate
String

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, Nullable<DateTime>, Nullable<TimeSpan>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, Nullable<DateTime> startDate, Nullable<TimeSpan> endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, DateTime? startDate, TimeSpan? endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * Nullable<DateTime> * Nullable<TimeSpan> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of DateTime), endDate As Nullable(Of TimeSpan)) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
Nullable<DateTime>

Primera fecha.

endDate
Nullable<TimeSpan>

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, Nullable<DateTime>, Nullable<DateTimeOffset>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, Nullable<DateTime> startDate, Nullable<DateTimeOffset> endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, DateTime? startDate, DateTimeOffset? endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * Nullable<DateTime> * Nullable<DateTimeOffset> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of DateTime), endDate As Nullable(Of DateTimeOffset)) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
Nullable<DateTime>

Primera fecha.

endDate
Nullable<DateTimeOffset>

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a

DateDiff(String, Nullable<DateTime>, Nullable<DateTime>)

Devuelve el recuento de los límites de parte de fecha especificados que se atraviesan entre la fecha de inicio y la fecha de fin definidas.

public:
 static Nullable<int> DateDiff(System::String ^ datePartArg, Nullable<DateTime> startDate, Nullable<DateTime> endDate);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")]
public static int? DateDiff (string datePartArg, DateTime? startDate, DateTime? endDate);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEDIFF")>]
static member DateDiff : string * Nullable<DateTime> * Nullable<DateTime> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of DateTime), endDate As Nullable(Of DateTime)) As Nullable(Of Integer)

Parámetros

datePartArg
String

Parte de la fecha que se usa para calcular los diferentes intervalos de tiempo.

startDate
Nullable<DateTime>

Primera fecha.

endDate
Nullable<DateTime>

Segunda fecha.

Devoluciones

Número de intervalos de tiempo que hay entre dos fechas.

Atributos

Comentarios

No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities.

Esta función se traduce a una función correspondiente de la base de datos. Para obtener información sobre la función SQL Server correspondiente, vea DATEDIFF (Transact-SQL).

Se aplica a