May 6, 2004 at 11:59 am
I have this problem with seconds doesn't display in my smalldatetime column.
select eventdate from tblLOG displays
2004-05-06 08:52:00.000
but when I do select getdate()
2004-05-06 10:49:37.060
I could not find why I don't get seconds from my frist query.
Any help would be greately appreciated!
May 6, 2004 at 1:03 pm
First off GETDATE() is inherently datetime as far as data type.
Try
select cast(getdate() as smalldatetime)
and you will get the same results of not having seconds in the output.
The reason is smalldatetime is only accurate down to the minute whereas datetime is accurate down to one three-hundredths of a second.
See "datetime and smalldatetime" in SQL BOL for a more in depth overview.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy