Question

How to add +1 day to convert?

Statement :-

declare @dtend char (10)
select @dtend = '14.03.2014'

declare @sdtend datetime
select  @sdtend = convert( datetime, @dtend, 104)
Was it helpful?

Solution

T-SQL Solution:
Use DATEADD function on the converted datetime value.

Try this:

select @sdtend = dateadd( day, 1, convert( datetime, @dtend, 104)

Refer to:

  1. CONVERT ( data_type [ ( length ) ] , expression [ , style ] )
    • Converts an expression of one data type to another.
  2. DATEADD (datepart , number , date )
    • Returns a specified date with the specified number interval (signed integer) added to a specified datepart of that date.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top