Some date math fun

Posted by drsql on SQL Blog See other posts from SQL Blog or by drsql
Published on Wed, 09 Feb 2011 05:01:46 GMT Indexed on 2011/02/09 7:30 UTC
Read the original article Hit count: 570

Filed under:
Note: This concept presented is pretty simple and I am not claiming that I am the first to do this… so if you were the one who came up with this, let me know and I will give you linkage Today I was needing to get the data for the current month for a query, and it hit me that I really didn’t have a good way to do this.  There were two common methods that people use: WHERE YEAR(MonthColumn) = YEAR(Getdate()) AND MONTH(MonthColumn) = MONTH(Getdate()) But this particular method is pretty horrible...(read more)

© SQL Blog or respective owner

Some date math fun

Posted by drsql on SQL Blog See other posts from SQL Blog or by drsql
Published on Wed, 09 Feb 2011 05:01:46 GMT Indexed on 2011/02/09 15:31 UTC
Read the original article Hit count: 569

Filed under:
Note: This concept presented is pretty simple and I am not claiming that I am the first to do this… so if you were the one who came up with this, let me know and I will give you linkage Today I was needing to get the data for the current month for a query, and it hit me that I really didn’t have a good way to do this.  There were two common methods that people use: WHERE YEAR(MonthColumn) = YEAR(Getdate()) AND MONTH(MonthColumn) = MONTH(Getdate()) But this particular method is pretty horrible...(read more)

© SQL Blog or respective owner