Im making a simple table in sql where i need to specify certain times. I use datatype time. I enter time like this: 5:38 It results in this: 05:38:00.0000000
How do I get rid of all the zeros? Do I have to change data-type?
Im making a simple table in sql where i need to specify certain times. I use datatype time. I enter time like this: 5:38 It results in this: 05:38:00.0000000
How do I get rid of all the zeros? Do I have to change data-type?
To summarize the comments from other users. Possible solutions are:
time(0)
(see the sqlfiddle)convert
to convert the results to your desired representation (also in sqlfiddle).Sample:
select convert(char(5), t, 108)
from tableName