What will be output of below query?

Select GetDate();
Select DateAdd(DD,15,GetDate());

 Posted by vishalneeraj-24503 on 12/4/2013 | Category: Sql Server Interview questions | Views: 2048 | Points: 40

Below will be the output:-

2013-12-04 16:40:50.683
2013-12-19 16:40:50.683

As we can see in the output,Time is Same but Date is Different as 04 December and 19 December.

So, DateAdd as the name implies,adds date to the supplied date.
DateAdd is an in-built Sql-Server function.

Here,DD means day which is a datepart.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response