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 |
|
pmccann1
Posting Yak Master
107 Posts |
Posted - 2008-06-24 : 11:23:53
|
| Hi there i am using the datediff funtion but it does not seem to be inclusive of the two dates egSELECT DATEDIFF(day, s_Date, e_date) AS NumberOfDays,*FROM weekendtesti know i could doSELECT DATEDIFF(day, s_Date, e_date)+1 AS NumberOfDays,*FROM weekendtestbut i was just wondering if there some other function i should use that would be more appropriate |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-06-24 : 11:28:47
|
Not really . . well if you don't like to + 1, you can use - 1  SELECT DATEDIFF(day, s_Date - 1, e_date) AS NumberOfDaysFROM weekendtest KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-06-24 : 13:05:19
|
| Datediff would exclude the first parameter date from countingMadhivananFailing to plan is Planning to fail |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|