EntityFunctions.DiffYears Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Invokes the canonical DiffYears
function. For information about the canonical DiffYears
function, see Date and Time Canonical Functions.
Overloads
DiffYears(Nullable<DateTime>, Nullable<DateTime>) |
Invokes the canonical |
DiffYears(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
Invokes the canonical |
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.
DiffYears(Nullable<DateTime>, Nullable<DateTime>)
Invokes the canonical DiffYears
function. For information about the canonical DiffYears
function, see Date and Time Canonical Functions.
public:
static Nullable<int> DiffYears(Nullable<DateTime> dateValue1, Nullable<DateTime> dateValue2);
[System.Data.Objects.DataClasses.EdmFunction("Edm", "DiffYears")]
public static int? DiffYears (DateTime? dateValue1, DateTime? dateValue2);
[<System.Data.Objects.DataClasses.EdmFunction("Edm", "DiffYears")>]
static member DiffYears : Nullable<DateTime> * Nullable<DateTime> -> Nullable<int>
Public Shared Function DiffYears (dateValue1 As Nullable(Of DateTime), dateValue2 As Nullable(Of DateTime)) As Nullable(Of Integer)
Parameters
Returns
The number of years 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
DiffYears(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
Invokes the canonical DiffYears
function. For information about the canonical DiffYears
function, see Date and Time Canonical Functions.
public:
static Nullable<int> DiffYears(Nullable<DateTimeOffset> dateValue1, Nullable<DateTimeOffset> dateValue2);
[System.Data.Objects.DataClasses.EdmFunction("Edm", "DiffYears")]
public static int? DiffYears (DateTimeOffset? dateValue1, DateTimeOffset? dateValue2);
[<System.Data.Objects.DataClasses.EdmFunction("Edm", "DiffYears")>]
static member DiffYears : Nullable<DateTimeOffset> * Nullable<DateTimeOffset> -> Nullable<int>
Public Shared Function DiffYears (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 years 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
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om