Syntax is : DATEADD(datepart,number,date)
Datepart are as follows
EG:
declare @d datetime
select @d=dateadd(day,1,getdate())
Datepart are as follows
| year | |
| quarter | |
| month | |
| dayofyear | |
| day | |
| week | |
| weekday | |
| hour | |
| minute | |
| second | |
| millisecond | |
| microsecond | |
| nanosecond |
EG:
declare @d datetime
select @d=dateadd(day,1,getdate())
No comments:
Post a Comment