Question:
Understanding ms sql server datetime type.?
QADEER
2010-10-29 08:39:24 UTC
Why sql doesn't have different variable type for date and time because it is taugh to compare datetime colectively. Please write the link of any good tutorial of this topic.
Four answers:
anonymous
2010-10-29 08:52:25 UTC
You have to learn to use the data type. There is absolutely no problem there.
AJ
2010-10-29 09:20:02 UTC
SQL Server has 6 different date and time datatypes, smalldatetime, datetime, datetime2, datetimeoffset, date, and time.



Each one has different accuracy from 100 nanoseconds to 1 day.
Pfo
2010-10-29 09:02:07 UTC
Their are dates, times, and datetimes. All three are different types. Sometimes you want to split the date and time components out, other times you don't.
TheMadProfessor
2010-10-29 10:18:10 UTC
Same reason they have smallint, int, float, etc. Different levels of precision are needed at different times...there's no need to store times down to the nanosecond if all you need is the date.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...