Search Results for

    Show / Hide Table of Contents

    Enum Sql.DateParts

    Namespace: LinqToDB
    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:
      • DB2
      • Oracle
    • SQLite numbering logic cannot be classified by human being

    WeekDay
    Year

    Extension Methods

    Map.DeepCopy<Sql.DateParts>()
    Sql.IsDistinctFrom<Sql.DateParts>(Sql.DateParts)
    Sql.IsDistinctFrom<Sql.DateParts>(Nullable<Sql.DateParts>)
    Sql.IsNotDistinctFrom<Sql.DateParts>(Sql.DateParts)
    Sql.IsNotDistinctFrom<Sql.DateParts>(Nullable<Sql.DateParts>)
    SqlExtensions.In<Sql.DateParts>(IEnumerable<Sql.DateParts>)
    SqlExtensions.In<Sql.DateParts>(IQueryable<Sql.DateParts>)
    SqlExtensions.In<Sql.DateParts>(Sql.DateParts[])
    SqlExtensions.In<Sql.DateParts>(Sql.DateParts, Sql.DateParts)
    SqlExtensions.In<Sql.DateParts>(Sql.DateParts, Sql.DateParts, Sql.DateParts)
    SqlExtensions.NotIn<Sql.DateParts>(IEnumerable<Sql.DateParts>)
    SqlExtensions.NotIn<Sql.DateParts>(IQueryable<Sql.DateParts>)
    SqlExtensions.NotIn<Sql.DateParts>(Sql.DateParts[])
    SqlExtensions.NotIn<Sql.DateParts>(Sql.DateParts, Sql.DateParts)
    SqlExtensions.NotIn<Sql.DateParts>(Sql.DateParts, Sql.DateParts, Sql.DateParts)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2011-2022 linq2db.com

    Generated by DocFX