Edit

Share via


SqlFunctions.DateName Method

Definition

Returns a character string that represents the specified datepart of the specified date.

Overloads

DateName(String, String)

Returns a character string that represents the specified datepart of the specified date.

DateName(String, Nullable<TimeSpan>)

Returns a character string that represents the specified datepart of the specified date.

DateName(String, Nullable<DateTimeOffset>)

Returns a character string that represents the specified datepart of the specified date.

DateName(String, Nullable<DateTime>)

Returns a character string that represents the specified datepart of the specified date.

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query.

This function is translated to a corresponding function in the database. For information about the corresponding SQL Server function, see DATENAME (Transact-SQL).

DateName(String, String)

Returns a character string that represents the specified datepart of the specified date.

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

Parameters

datePartArg
String

The part of the date to calculate the differing number of time intervals.

date
String

The date.

Returns

The specified part of the specified date.

Attributes

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query.

This function is translated to a corresponding function in the database. For information about the corresponding SQL Server function, see DATENAME (Transact-SQL).

Applies to

DateName(String, Nullable<TimeSpan>)

Returns a character string that represents the specified datepart of the specified date.

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

Parameters

datePartArg
String

The part of the date to calculate the differing number of time intervals.

date
Nullable<TimeSpan>

The date.

Returns

The specified part of the specified date.

Attributes

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query.

This function is translated to a corresponding function in the database. For information about the corresponding SQL Server function, see DATENAME (Transact-SQL).

Applies to

DateName(String, Nullable<DateTimeOffset>)

Returns a character string that represents the specified datepart of the specified date.

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

Parameters

datePartArg
String

The part of the date to calculate the differing number of time intervals.

date
Nullable<DateTimeOffset>

The date.

Returns

The specified part of the specified date.

Attributes

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query.

This function is translated to a corresponding function in the database. For information about the corresponding SQL Server function, see DATENAME (Transact-SQL).

Applies to

DateName(String, Nullable<DateTime>)

Returns a character string that represents the specified datepart of the specified date.

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

Parameters

datePartArg
String

The part of the date to calculate the differing number of time intervals.

date
Nullable<DateTime>

The date.

Returns

The specified part of the specified date.

Attributes

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query.

This function is translated to a corresponding function in the database. For information about the corresponding SQL Server function, see DATENAME (Transact-SQL).

Applies to