SqlFunctions.DateAdd SqlFunctions.DateAdd SqlFunctions.DateAdd SqlFunctions.DateAdd Method

Definition

Returns a new datetime value based on adding an interval to the specified date.

Overloads

DateAdd(String, Nullable<Double>, String) DateAdd(String, Nullable<Double>, String) DateAdd(String, Nullable<Double>, String) DateAdd(String, Nullable<Double>, String)

Returns a new datetime value based on adding an interval to the specified date.

DateAdd(String, Nullable<Double>, Nullable<TimeSpan>) DateAdd(String, Nullable<Double>, Nullable<TimeSpan>) DateAdd(String, Nullable<Double>, Nullable<TimeSpan>) DateAdd(String, Nullable<Double>, Nullable<TimeSpan>)

Returns a new time span value based on adding an interval to the specified time span.

DateAdd(String, Nullable<Double>, Nullable<DateTimeOffset>) DateAdd(String, Nullable<Double>, Nullable<DateTimeOffset>) DateAdd(String, Nullable<Double>, Nullable<DateTimeOffset>) DateAdd(String, Nullable<Double>, Nullable<DateTimeOffset>)

Returns a new date value based on adding an interval to the specified date.

DateAdd(String, Nullable<Double>, Nullable<DateTime>) DateAdd(String, Nullable<Double>, Nullable<DateTime>) DateAdd(String, Nullable<Double>, Nullable<DateTime>) DateAdd(String, Nullable<Double>, Nullable<DateTime>)

Returns a new datetime value based on adding an interval to 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 DATEADD (Transact-SQL).

DateAdd(String, Nullable<Double>, String) DateAdd(String, Nullable<Double>, String) DateAdd(String, Nullable<Double>, String) DateAdd(String, Nullable<Double>, String)

Returns a new datetime value based on adding an interval to the specified date.

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

Parameters

datePartArg
String String String String

The part of the date to increment.

number
Nullable<Double>

The value used to increment a date by a specified amount.

date
String String String String

The date to increment.

Returns

A Nullable<T> of DateTime value that is the new 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 DATEADD (Transact-SQL).

DateAdd(String, Nullable<Double>, Nullable<TimeSpan>) DateAdd(String, Nullable<Double>, Nullable<TimeSpan>) DateAdd(String, Nullable<Double>, Nullable<TimeSpan>) DateAdd(String, Nullable<Double>, Nullable<TimeSpan>)

Returns a new time span value based on adding an interval to the specified time span.

public:
 static Nullable<TimeSpan> DateAdd(System::String ^ datePartArg, Nullable<double> number, Nullable<TimeSpan> time);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEADD")]
public static Nullable<TimeSpan> DateAdd (string datePartArg, Nullable<double> number, Nullable<TimeSpan> time);
static member DateAdd : string * Nullable<double> * Nullable<TimeSpan> -> Nullable<TimeSpan>
Public Shared Function DateAdd (datePartArg As String, number As Nullable(Of Double), time As Nullable(Of TimeSpan)) As Nullable(Of TimeSpan)

Parameters

datePartArg
String String String String

The part of the date to increment.

number
Nullable<Double>

The value used to increment a date by a specified amount.

time
Nullable<TimeSpan>

The time span to increment.

Returns

The new time span.

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 DATEADD (Transact-SQL).

DateAdd(String, Nullable<Double>, Nullable<DateTimeOffset>) DateAdd(String, Nullable<Double>, Nullable<DateTimeOffset>) DateAdd(String, Nullable<Double>, Nullable<DateTimeOffset>) DateAdd(String, Nullable<Double>, Nullable<DateTimeOffset>)

Returns a new date value based on adding an interval to the specified date.

public:
 static Nullable<DateTimeOffset> DateAdd(System::String ^ datePartArg, Nullable<double> number, Nullable<DateTimeOffset> dateTimeOffsetArg);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "DATEADD")]
public static Nullable<DateTimeOffset> DateAdd (string datePartArg, Nullable<double> number, Nullable<DateTimeOffset> dateTimeOffsetArg);
static member DateAdd : string * Nullable<double> * Nullable<DateTimeOffset> -> Nullable<DateTimeOffset>
Public Shared Function DateAdd (datePartArg As String, number As Nullable(Of Double), dateTimeOffsetArg As Nullable(Of DateTimeOffset)) As Nullable(Of DateTimeOffset)

Parameters

datePartArg
String String String String

The part of the date to increment.

number
Nullable<Double>

The value used to increment a date by a specified amount.

dateTimeOffsetArg
Nullable<DateTimeOffset>

The date to increment.

Returns

The new point in time, expressed as a date and time of day, relative to Coordinated Universal Time (UTC).

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 DATEADD (Transact-SQL).

DateAdd(String, Nullable<Double>, Nullable<DateTime>) DateAdd(String, Nullable<Double>, Nullable<DateTime>) DateAdd(String, Nullable<Double>, Nullable<DateTime>) DateAdd(String, Nullable<Double>, Nullable<DateTime>)

Returns a new datetime value based on adding an interval to the specified date.

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

Parameters

datePartArg
String String String String

The part of the date to increment.

number
Nullable<Double>

The value used to increment a date by a specified amount.

date
Nullable<DateTime>

The date to increment.

Returns

The new 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 DATEADD (Transact-SQL).

Applies to