Edit

Share via


EntityFunctions.DiffMonths Method

Definition

Invokes the canonical DiffMonths function. For information about the canonical DiffMonths function, see Date and Time Canonical Functions.

Overloads

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

Invokes the canonical DiffMonths function. For information about the canonical DiffMonths function, see Date and Time Canonical Functions.

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

Invokes the canonical DiffMonths function. For information about the canonical DiffMonths function, see Date and Time Canonical Functions.

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.

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

Invokes the canonical DiffMonths function. For information about the canonical DiffMonths function, see Date and Time Canonical Functions.

public:
 static Nullable<int> DiffMonths(Nullable<DateTimeOffset> dateValue1, Nullable<DateTimeOffset> dateValue2);
[System.Data.Objects.DataClasses.EdmFunction("Edm", "DiffMonths")]
public static int? DiffMonths (DateTimeOffset? dateValue1, DateTimeOffset? dateValue2);
[<System.Data.Objects.DataClasses.EdmFunction("Edm", "DiffMonths")>]
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>

A valid date time offset.

dateValue2
Nullable<DateTimeOffset>

A valid date time offset.

Returns

The number of months between dateValue1 and dateValue2.

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>)

Invokes the canonical DiffMonths function. For information about the canonical DiffMonths function, see Date and Time Canonical Functions.

public:
 static Nullable<int> DiffMonths(Nullable<DateTime> dateValue1, Nullable<DateTime> dateValue2);
[System.Data.Objects.DataClasses.EdmFunction("Edm", "DiffMonths")]
public static int? DiffMonths (DateTime? dateValue1, DateTime? dateValue2);
[<System.Data.Objects.DataClasses.EdmFunction("Edm", "DiffMonths")>]
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>

A valid date.

dateValue2
Nullable<DateTime>

A valid date.

Returns

The number of months between dateValue1 and dateValue2.

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