home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 17,769 of 19,505   
   Plamen Ratchev to All   
   Re: Last 3 months from now   
   02 Mar 10 18:54:56   
   
   09d9c4d6   
   From: Plamen@SQLStudio.com   
      
   The best would be to use a half-open interval:   
      
   SELECT    
   FROM Foo   
   WHERE datecol >= DATEADD(MONTH, DATEDIFF(MONTH, 0, CURRENT_TIMESTAMP) - 3, 0)   
      AND datecol <  DATEADD(MONTH, DATEDIFF(MONTH, 0, CURRENT_TIMESTAMP), 0);   
      
   --   
   Plamen Ratchev   
   http://www.SQLStudio.com   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca