共用方式為


SqlFunctions.DateName 方法

定義

傳回字元字串,這個字元字串表示指定日期的指定日期部分。

多載

DateName(String, String)

傳回字元字串,這個字元字串表示指定日期的指定日期部分。

DateName(String, Nullable<TimeSpan>)

傳回字元字串,這個字元字串表示指定日期的指定日期部分。

DateName(String, Nullable<DateTimeOffset>)

傳回字元字串,這個字元字串表示指定日期的指定日期部分。

DateName(String, Nullable<DateTime>)

傳回字元字串,這個字元字串表示指定日期的指定日期部分。

備註

您無法直接呼叫此函式。 此函式只能出現在 LINQ to Entities 查詢內。

此函式會轉譯為資料庫中的對應函式。 如需對應 SQL Server 函數的相關信息,請參閱 DATENAME (Transact-SQL)

DateName(String, String)

傳回字元字串,這個字元字串表示指定日期的指定日期部分。

public:
 static System::String ^ DateName(System::String ^ datePartArg, System::String ^ date);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATENAME")]
public static string DateName(string datePartArg, string date);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATENAME")>]
static member DateName : string * string -> string
Public Shared Function DateName (datePartArg As String, date As String) As String

參數

datePartArg
String

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

date
String

日期。

傳回

指定之日期的指定部分。

屬性

備註

您無法直接呼叫此函式。 此函式只能出現在 LINQ to Entities 查詢內。

此函式會轉譯為資料庫中的對應函式。 如需對應 SQL Server 函數的相關信息,請參閱 DATENAME (Transact-SQL)

適用於

DateName(String, Nullable<TimeSpan>)

傳回字元字串,這個字元字串表示指定日期的指定日期部分。

public:
 static System::String ^ DateName(System::String ^ datePartArg, Nullable<TimeSpan> date);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATENAME")]
public static string DateName(string datePartArg, TimeSpan? date);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATENAME")>]
static member DateName : string * Nullable<TimeSpan> -> string
Public Shared Function DateName (datePartArg As String, date As Nullable(Of TimeSpan)) As String

參數

datePartArg
String

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

date
Nullable<TimeSpan>

日期。

傳回

指定之日期的指定部分。

屬性

備註

您無法直接呼叫此函式。 此函式只能出現在 LINQ to Entities 查詢內。

此函式會轉譯為資料庫中的對應函式。 如需對應 SQL Server 函數的相關信息,請參閱 DATENAME (Transact-SQL)

適用於

DateName(String, Nullable<DateTimeOffset>)

傳回字元字串,這個字元字串表示指定日期的指定日期部分。

public:
 static System::String ^ DateName(System::String ^ datePartArg, Nullable<DateTimeOffset> date);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATENAME")]
public static string DateName(string datePartArg, DateTimeOffset? date);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATENAME")>]
static member DateName : string * Nullable<DateTimeOffset> -> string
Public Shared Function DateName (datePartArg As String, date As Nullable(Of DateTimeOffset)) As String

參數

datePartArg
String

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

date
Nullable<DateTimeOffset>

日期。

傳回

指定之日期的指定部分。

屬性

備註

您無法直接呼叫此函式。 此函式只能出現在 LINQ to Entities 查詢內。

此函式會轉譯為資料庫中的對應函式。 如需對應 SQL Server 函數的相關信息,請參閱 DATENAME (Transact-SQL)

適用於

DateName(String, Nullable<DateTime>)

傳回字元字串,這個字元字串表示指定日期的指定日期部分。

public:
 static System::String ^ DateName(System::String ^ datePartArg, Nullable<DateTime> date);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATENAME")]
public static string DateName(string datePartArg, DateTime? date);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATENAME")>]
static member DateName : string * Nullable<DateTime> -> string
Public Shared Function DateName (datePartArg As String, date As Nullable(Of DateTime)) As String

參數

datePartArg
String

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

date
Nullable<DateTime>

日期。

傳回

指定之日期的指定部分。

屬性

備註

您無法直接呼叫此函式。 此函式只能出現在 LINQ to Entities 查詢內。

此函式會轉譯為資料庫中的對應函式。 如需對應 SQL Server 函數的相關信息,請參閱 DATENAME (Transact-SQL)

適用於