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 |
oracle_corrgi
Yak Posting Veteran
98 Posts |
Posted - 2006-09-19 : 03:33:17
|
hihow do i find date month year diffthanxsdatabase |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-19 : 03:40:29
|
To what date do you want to compare? Today's date? To get current date and time, use SELECT GETDATE()When you are used to that function, you can learn more about DATEDIFF function, to get the diff's you want. There are special considerations though. The difference is time between 20060919 23:59:59 and 20060920 00:00:01is, when usingsecond time interval: 2minute time interval: 1hour time interval: 1hour day interval: 1DATEDIFF uses the "occupied" timeslot according to the resolution you choose, when calculating the diff in time.Peter LarssonHelsingborg, Sweden |
|
|
|
|
|