November 16, 2015 at 9:28 am
I need to calculate a date from specific date. For e.g. If my date is 2015-10-08 and i want to see date after 4/14 months. How can i do that?
November 16, 2015 at 9:47 am
sqlinterset (11/16/2015)
I need to calculate a date from specific date. For e.g. If my date is 2015-10-08 and i want to see date after 4/14 months. How can i do that?
What does "after 4/14 months" mean? Generically I would just suggest using DATEADD but I have no idea what to suggest for values because 4/14 doesn't make sense to me.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 16, 2015 at 10:01 am
sorry for confusion. 4/14 mean either 4 months or 14 months.
November 16, 2015 at 10:07 am
sqlinterset (11/16/2015)
sorry for confusion. 4/14 mean either 4 months or 14 months.
dateadd(month,4,@CurrentDate);
dateadd(month,14,@CurrentDate);
A quick look in Books Online would have answered this question a lot faster than posting it on the forums.
November 16, 2015 at 10:07 am
sqlinterset (11/16/2015)
sorry for confusion. 4/14 mean either 4 months or 14 months.
Then use DATEADD. https://msdn.microsoft.com/en-us/library/ms186819.aspx
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply