SqlServerDbFunctionsExtensions.DateDiffWeek 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.
Overloads
DateDiffWeek(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
Counts the number of week boundaries crossed between the |
DateDiffWeek(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
Counts the number of week boundaries crossed between the |
DateDiffWeek(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
Counts the number of week boundaries crossed between the |
DateDiffWeek(DbFunctions, DateTime, DateTime) |
Counts the number of week boundaries crossed between the |
DateDiffWeek(DbFunctions, DateOnly, DateOnly) |
Counts the number of week boundaries crossed between the |
DateDiffWeek(DbFunctions, DateTimeOffset, DateTimeOffset) |
Counts the number of week boundaries crossed between the |
DateDiffWeek(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
Counts the number of week boundaries crossed between the startDate
and endDate
.
Corresponds to SQL Server's DATEDIFF(week, @startDate, @endDate)
.
public static int? DateDiffWeek (this Microsoft.EntityFrameworkCore.DbFunctions _, DateTimeOffset? startDate, DateTimeOffset? endDate);
static member DateDiffWeek : Microsoft.EntityFrameworkCore.DbFunctions * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> -> Nullable<int>
<Extension()>
Public Function DateDiffWeek (_ As DbFunctions, startDate As Nullable(Of DateTimeOffset), endDate As Nullable(Of DateTimeOffset)) As Nullable(Of Integer)
Parameters
The DbFunctions instance.
- startDate
- Nullable<DateTimeOffset>
Starting date for the calculation.
- endDate
- Nullable<DateTimeOffset>
Ending date for the calculation.
Returns
Number of week boundaries crossed between the dates.
Remarks
See Database functions, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.
Applies to
DateDiffWeek(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)
Counts the number of week boundaries crossed between the startDate
and endDate
.
Corresponds to SQL Server's DATEDIFF(week, @startDate, @endDate)
.
public static int? DateDiffWeek (this Microsoft.EntityFrameworkCore.DbFunctions _, DateTime? startDate, DateTime? endDate);
static member DateDiffWeek : Microsoft.EntityFrameworkCore.DbFunctions * Nullable<DateTime> * Nullable<DateTime> -> Nullable<int>
<Extension()>
Public Function DateDiffWeek (_ As DbFunctions, startDate As Nullable(Of DateTime), endDate As Nullable(Of DateTime)) As Nullable(Of Integer)
Parameters
The DbFunctions instance.
Returns
Number of week boundaries crossed between the dates.
Remarks
See Database functions, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.
Applies to
DateDiffWeek(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>)
Counts the number of week boundaries crossed between the startDate
and endDate
.
Corresponds to SQL Server's DATEDIFF(week, @startDate, @endDate)
.
public static int? DateDiffWeek (this Microsoft.EntityFrameworkCore.DbFunctions _, DateOnly? startDate, DateOnly? endDate);
static member DateDiffWeek : Microsoft.EntityFrameworkCore.DbFunctions * Nullable<DateOnly> * Nullable<DateOnly> -> Nullable<int>
<Extension()>
Public Function DateDiffWeek (_ As DbFunctions, startDate As Nullable(Of DateOnly), endDate As Nullable(Of DateOnly)) As Nullable(Of Integer)
Parameters
The DbFunctions instance.
Returns
Number of week boundaries crossed between the dates.
Remarks
See Database functions, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.
Applies to
DateDiffWeek(DbFunctions, DateTime, DateTime)
Counts the number of week boundaries crossed between the startDate
and endDate
.
Corresponds to SQL Server's DATEDIFF(week, @startDate, @endDate)
.
public static int DateDiffWeek (this Microsoft.EntityFrameworkCore.DbFunctions _, DateTime startDate, DateTime endDate);
static member DateDiffWeek : Microsoft.EntityFrameworkCore.DbFunctions * DateTime * DateTime -> int
<Extension()>
Public Function DateDiffWeek (_ As DbFunctions, startDate As DateTime, endDate As DateTime) As Integer
Parameters
The DbFunctions instance.
- startDate
- DateTime
Starting date for the calculation.
- endDate
- DateTime
Ending date for the calculation.
Returns
Number of week boundaries crossed between the dates.
Remarks
See Database functions, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.
Applies to
DateDiffWeek(DbFunctions, DateOnly, DateOnly)
Counts the number of week boundaries crossed between the startDate
and endDate
.
Corresponds to SQL Server's DATEDIFF(week, @startDate, @endDate)
.
public static int DateDiffWeek (this Microsoft.EntityFrameworkCore.DbFunctions _, DateOnly startDate, DateOnly endDate);
static member DateDiffWeek : Microsoft.EntityFrameworkCore.DbFunctions * DateOnly * DateOnly -> int
<Extension()>
Public Function DateDiffWeek (_ As DbFunctions, startDate As DateOnly, endDate As DateOnly) As Integer
Parameters
The DbFunctions instance.
- startDate
- DateOnly
Starting date for the calculation.
- endDate
- DateOnly
Ending date for the calculation.
Returns
Number of week boundaries crossed between the dates.
Remarks
See Database functions, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.
Applies to
DateDiffWeek(DbFunctions, DateTimeOffset, DateTimeOffset)
Counts the number of week boundaries crossed between the startDate
and endDate
.
Corresponds to SQL Server's DATEDIFF(week, @startDate, @endDate)
.
public static int DateDiffWeek (this Microsoft.EntityFrameworkCore.DbFunctions _, DateTimeOffset startDate, DateTimeOffset endDate);
static member DateDiffWeek : Microsoft.EntityFrameworkCore.DbFunctions * DateTimeOffset * DateTimeOffset -> int
<Extension()>
Public Function DateDiffWeek (_ As DbFunctions, startDate As DateTimeOffset, endDate As DateTimeOffset) As Integer
Parameters
The DbFunctions instance.
- startDate
- DateTimeOffset
Starting date for the calculation.
- endDate
- DateTimeOffset
Ending date for the calculation.
Returns
Number of week boundaries crossed between the dates.
Remarks
See Database functions, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.
Applies to
Entity Framework