﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 7,2000 / T-SQL  / DateAdd / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 12:56:19 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: DateAdd</title><link>http://www.sqlservercentral.com/Forums/Topic215039-8-1.aspx</link><description>Hey Mike - no one's offended! Just double checking to make sure!&lt;img src='images/emotions/smile.gif' height='20' width='20' border='0' title='Smile' align='absmiddle'&gt;</description><pubDate>Mon, 29 Aug 2005 18:58:00 GMT</pubDate><dc:creator>sushila</dc:creator></item><item><title>RE: DateAdd</title><link>http://www.sqlservercentral.com/Forums/Topic215039-8-1.aspx</link><description>&lt;P&gt;Yes I was asking the same thing. I though I should start a new thread since it was somthing different. &lt;/P&gt;&lt;P&gt;I appologize if it offended someone. &lt;/P&gt;</description><pubDate>Mon, 29 Aug 2005 15:44:00 GMT</pubDate><dc:creator>Mike-238404</dc:creator></item><item><title>RE: DateAdd</title><link>http://www.sqlservercentral.com/Forums/Topic215039-8-1.aspx</link><description>mike - isn't this the same as what is being discussed on this other thread..?!?!&lt;a href="http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&amp;messageid=214932"&gt;other thread&lt;/a&gt;</description><pubDate>Mon, 29 Aug 2005 14:57:00 GMT</pubDate><dc:creator>sushila</dc:creator></item><item><title>RE: DateAdd</title><link>http://www.sqlservercentral.com/Forums/Topic215039-8-1.aspx</link><description>&lt;P&gt;I thought the same thing but it shows the correct date and time. It's my local PC&amp;lt;G&amp;gt;&lt;/P&gt;&lt;P&gt;Still getting a startdate of 2003 -24 and nothing on 24 or +24&lt;/P&gt;&lt;P&gt;The filed is a smalldatetime on SQL 2000 .&lt;/P&gt;&lt;P&gt;If I do WHERE (DISCONTINUEDDATE &amp;gt;= '01/01/2005') I get 01/01/2005 and up correctly as well.&lt;/P&gt;&lt;P&gt;Thanks for all of the help!!&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Mon, 29 Aug 2005 14:09:00 GMT</pubDate><dc:creator>Mike-238404</dc:creator></item><item><title>RE: DateAdd</title><link>http://www.sqlservercentral.com/Forums/Topic215039-8-1.aspx</link><description>SELECT TYPE,vendor,discontinueddate, datepart(quarter,[discontinueddate]) AS 'Quarter'from dbo.EOLWHERE DISCONTINUEDDATE &gt; DateAdd(M,-24,GETDATE()) and DISCONTINUEDDATE &lt; DATEADD(D, 1, DATEDIFF(D, 0, GetDate()))Order by Discontinueddate</description><pubDate>Mon, 29 Aug 2005 13:55:00 GMT</pubDate><dc:creator>Ninja's_RGR'us</dc:creator></item><item><title>RE: DateAdd</title><link>http://www.sqlservercentral.com/Forums/Topic215039-8-1.aspx</link><description>&lt;P&gt;You say it goes from 2003 to 2009.&lt;/P&gt;&lt;P&gt;Run this:SELECT GETDATE()&lt;/P&gt;&lt;P&gt;That will show you what the server's date is set as. If you are getting 2009, it looks like your system date is off.&lt;/P&gt;&lt;P&gt;Note that Remi's suggestion does NOT have the quotes around the M in the DATEADD function, where yours did. Remi's is the correct way of doing it.  If you want 24 months earlier than GETDATE(), use the -24 otherwise make it 24.&lt;/P&gt;&lt;P&gt;-SQLBill&lt;/P&gt;</description><pubDate>Mon, 29 Aug 2005 13:55:00 GMT</pubDate><dc:creator>SQLBill</dc:creator></item><item><title>RE: DateAdd</title><link>http://www.sqlservercentral.com/Forums/Topic215039-8-1.aspx</link><description>&lt;P&gt;For some reason that makes it go from 2003 - 2009&lt;/P&gt;&lt;P&gt;I need current day plus 24 months so I can show 8 quarters of info at a time.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;</description><pubDate>Mon, 29 Aug 2005 13:50:00 GMT</pubDate><dc:creator>Mike-238404</dc:creator></item><item><title>RE: DateAdd</title><link>http://www.sqlservercentral.com/Forums/Topic215039-8-1.aspx</link><description>SELECT TYPE,vendor,discontinueddate, datepart(quarter,[discontinueddate]) AS 'Quarter'from dbo.EOLWHERE DISCONTINUEDDATE &gt; DateAdd(M,-24,GETDATE())Order by Discontinueddate </description><pubDate>Mon, 29 Aug 2005 13:43:00 GMT</pubDate><dc:creator>Ninja's_RGR'us</dc:creator></item><item><title>DateAdd</title><link>http://www.sqlservercentral.com/Forums/Topic215039-8-1.aspx</link><description>&lt;P&gt;Trying build this some that it will return 24 months from the current day. What am I doing wrong??&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;SELECT TYPE,vendor,discontinueddate, datepart(quarter,[discontinueddate]) AS 'Quarter'from EOL WHERE DISCONTINUEDDATE &amp;lt;DateAdd("M",24,GETDATE())and (DISCONTINUEDDATE = '01/01/2005')Order by Discontinueddate&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description><pubDate>Mon, 29 Aug 2005 13:41:00 GMT</pubDate><dc:creator>Mike-238404</dc:creator></item></channel></rss>