Friday, March 9, 2012

how can i insert time 12:00:00 AM into sql server

my problem is that while i insert Time into datetime coloumn , it shows only 01/01/1900.
it doesn't not shows '01/01/1900 12:00:00 AM'
I run the following query
insert into table1 values('1900/01/01 12:00:00 AM','1900/01/01 11:59:59 PM')
result
column1 Column2
01/01/1900 01/01/1900 11:59:59 PM
how can i solve this problem


If you need to use a SELECT statement to view time, use a CAST or CONVERT. Look these up in SQL help - there are loads of examples

No comments:

Post a Comment