Enum Sql.DateParts
Assembly: linq2db.dll
Syntax
public enum DateParts : int
Fields
Name |
Description |
Day |
|
DayOfYear |
|
Hour |
|
Millisecond |
|
Minute |
|
Month |
|
Quarter |
|
Second |
|
Week |
This date part behavior depends on used database and also depends on where if calculated - in C# code or in database.
Eeach database could have own week numbering logic, see notes below.
Current implementation uses following schemas per-provider:
C# evaluation:
CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(date.Value, CalendarWeekRule.FirstDay, DayOfWeek.Sunday)
Databases:
- US numbering schema used by:
- MS Access
- SQL CE
- SQL Server
- SAP/Sybase ASE
- Informix
- US 0-based numbering schema used by MySQL database
- ISO numbering schema with incorrect numbering of first week used by SAP HANA database
- ISO numbering schema with proper numbering of first week used by:
- Firebird
- PostgreSQL
- ClickHouse
- Primitive (each 7 days counted as week) numbering schema:
- SQLite numbering logic cannot be classified by human being
|
WeekDay |
|
Year |
|
Extension Methods