문제

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