select dateadd(s, -1, dateadd(month, datediff(month, 0, getdate())+1,0))
when i execute this query, it gives '2012-01-30 23:59:59.000'. I donno how to get it as '2012-01-30 23:59:59.997'. If anybody Know, please say.
thanking you!!!
|
select dateadd(s, -1, dateadd(month, datediff(month, 0, getdate())+1,0)) when i execute this query, it gives '2012-01-30 23:59:59.000'. I donno how to get it as '2012-01-30 23:59:59.997'. If anybody Know, please say. thanking you!!! |
|||
|
Why on earth do you need the last possible value of today? Stop using
The problem with what you're doing is that the data type can affect what happens. If the underlying data type is |
|||||||||
|
sis for seconds.msis for milliseconds: DATEADD() function. – ypercube Sep 5 '12 at 11:15