Share via


EntityFunctions.DiffMonths Method

Definition

Overloads

DiffMonths(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffMonths EDM function to calculate the number of months between two date/times.

DiffMonths(Nullable<DateTime>, Nullable<DateTime>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffMonths EDM function to calculate the number of months between two date/times.

DiffMonths(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffMonths EDM function to calculate the number of months between two date/times.

[System.Data.Entity.DbFunction("Edm", "DiffMonths")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="dateValue1")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="dateValue2")]
public static Nullable<int> DiffMonths (Nullable<DateTimeOffset> dateValue1, Nullable<DateTimeOffset> dateValue2);
static member DiffMonths : Nullable<DateTimeOffset> * Nullable<DateTimeOffset> -> Nullable<int>
Public Shared Function DiffMonths (dateValue1 As Nullable(Of DateTimeOffset), dateValue2 As Nullable(Of DateTimeOffset)) As Nullable(Of Integer)

Parameters

dateValue1
Nullable<DateTimeOffset>

The first date/time.

dateValue2
Nullable<DateTimeOffset>

The second date/time.

Returns

The number of months between the first and second date/times.

Attributes

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query. This function is translated to a corresponding function in the database.

Applies to

DiffMonths(Nullable<DateTime>, Nullable<DateTime>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffMonths EDM function to calculate the number of months between two date/times.

[System.Data.Entity.DbFunction("Edm", "DiffMonths")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="dateValue1")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="dateValue2")]
public static Nullable<int> DiffMonths (Nullable<DateTime> dateValue1, Nullable<DateTime> dateValue2);
static member DiffMonths : Nullable<DateTime> * Nullable<DateTime> -> Nullable<int>
Public Shared Function DiffMonths (dateValue1 As Nullable(Of DateTime), dateValue2 As Nullable(Of DateTime)) As Nullable(Of Integer)

Parameters

dateValue1
Nullable<DateTime>

The first date/time.

dateValue2
Nullable<DateTime>

The second date/time.

Returns

The number of months between the first and second date/times.

Attributes

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query. This function is translated to a corresponding function in the database.

Applies to