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)
有帮助吗?

解决方案

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.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top