Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sushma patle
Starting Member
15 Posts |
Posted - 2008-05-21 : 02:54:39
|
| SELECT CAST(CONVERT(VARCHAR(10), GETDATE(), 108) AS DATETIME) AS [CurrentTime]then output isCurrentTime-------------------------1900-01-01 09:30:25.000 there date is 1900-01-01why ?spatle |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-05-21 : 03:04:44
|
because you are asking SQL Server to turn the time (in the CONVERT) back into a datetime. As there is no date part to the convert, this then takes the start date for SQL Server.You could find this out yourrself by just running:SELECT CONVERT(VARCHAR(10), GETDATE(), 108) AS [CurrentTime] |
 |
|
|
|
|
|