共用方式為


SqlCeFunctions.DateDiff 方法

定義

多載

DateDiff(String, Nullable<DateTime>, Nullable<DateTime>)

傳回指定的開始和結束日期之間,指定之日期部分界線交集的次數。

DateDiff(String, Nullable<DateTime>, String)

傳回指定的開始和結束日期之間,指定之日期部分界線交集的次數。

DateDiff(String, String, Nullable<DateTime>)

傳回指定的開始和結束日期之間,指定之日期部分界線交集的次數。

DateDiff(String, String, String)

傳回指定的開始和結束日期之間,指定之日期部分界線交集的次數。

DateDiff(String, Nullable<DateTime>, Nullable<DateTime>)

傳回指定的開始和結束日期之間,指定之日期部分界線交集的次數。

[System.Data.Entity.DbFunction("SqlServerCe", "DATEDIFF")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="startDate")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="datePartArg")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="endDate")]
public static Nullable<int> DateDiff(string datePartArg, Nullable<DateTime> startDate, Nullable<DateTime> endDate);
static member DateDiff : string * Nullable<DateTime> * Nullable<DateTime> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of DateTime), endDate As Nullable(Of DateTime)) As Nullable(Of Integer)

參數

datePartArg
String

要計算時間間隔數目差異的日期部分。

startDate
Nullable<DateTime>

第一個日期。

endDate
Nullable<DateTime>

第二個日期。

傳回

兩個日期之間的時間間隔數目。

屬性

適用於

DateDiff(String, Nullable<DateTime>, String)

傳回指定的開始和結束日期之間,指定之日期部分界線交集的次數。

[System.Data.Entity.DbFunction("SqlServerCe", "DATEDIFF")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="datePartArg")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="endDate")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="startDate")]
public static Nullable<int> DateDiff(string datePartArg, Nullable<DateTime> startDate, string endDate);
static member DateDiff : string * Nullable<DateTime> * string -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As Nullable(Of DateTime), endDate As String) As Nullable(Of Integer)

參數

datePartArg
String

要計算時間間隔數目差異的日期部分。

startDate
Nullable<DateTime>

第一個日期。

endDate
String

第二個日期。

傳回

兩個日期之間的時間間隔數目。

屬性

適用於

DateDiff(String, String, Nullable<DateTime>)

傳回指定的開始和結束日期之間,指定之日期部分界線交集的次數。

[System.Data.Entity.DbFunction("SqlServerCe", "DATEDIFF")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="endDate")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="datePartArg")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="startDate")]
public static Nullable<int> DateDiff(string datePartArg, string startDate, Nullable<DateTime> endDate);
static member DateDiff : string * string * Nullable<DateTime> -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As String, endDate As Nullable(Of DateTime)) As Nullable(Of Integer)

參數

datePartArg
String

要計算時間間隔數目差異的日期部分。

startDate
String

第一個日期。

endDate
Nullable<DateTime>

第二個日期。

傳回

兩個日期之間的時間間隔數目。

屬性

適用於

DateDiff(String, String, String)

傳回指定的開始和結束日期之間,指定之日期部分界線交集的次數。

[System.Data.Entity.DbFunction("SqlServerCe", "DATEDIFF")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="datePartArg")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="endDate")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="startDate")]
public static Nullable<int> DateDiff(string datePartArg, string startDate, string endDate);
static member DateDiff : string * string * string -> Nullable<int>
Public Shared Function DateDiff (datePartArg As String, startDate As String, endDate As String) As Nullable(Of Integer)

參數

datePartArg
String

要計算時間間隔數目差異的日期部分。

startDate
String

第一個日期。

endDate
String

第二個日期。

傳回

兩個日期之間的時間間隔數目。

屬性

適用於