EdmFunctions.DiffMonths(DbExpression, DbExpression) Method

Definition

Creates a DbFunctionExpression that invokes the canonical 'DiffMonths' function with the specified arguments, which must each have DateTime or DateTimeOffset result type. The result type of the expression is Edm.Int32.

C#
public static System.Data.Common.CommandTrees.DbFunctionExpression DiffMonths(this System.Data.Common.CommandTrees.DbExpression dateValue1, System.Data.Common.CommandTrees.DbExpression dateValue2);

Parameters

dateValue1
DbExpression

An expression that specifies the first date value argument.

dateValue2
DbExpression

An expression that specifies the second date value argument.

Returns

A new DbFunctionExpression that returns the number of months that is the difference between dateValue1 and dateValue2.

Applies to

Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1