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 |
|
rammohan
Posting Yak Master
212 Posts |
Posted - 2007-06-06 : 11:35:09
|
| here i wabt to get the dates b/w two input dates.i.e input : date1: 11/2/2004 date2 : 14/2/2004i want out put as12/2/200413/2/2004please suggest me a function or query to acheive thisOne can never consent to creep,when one feels an impulse to soarRAMMOHAN |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-06-06 : 11:36:55
|
| Make use of F_Table_Date function here: [url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519[/url]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
ranganath
Posting Yak Master
209 Posts |
Posted - 2007-06-07 : 01:32:28
|
| Declare @StartDate datetime, @EndDate datetimeSelect @startDate = '7/2/2007', @EndDate = '7/5/2007'Select * from(select date = dateadd(day,number,@StartDate) from master..spt_valueswhere name is null and type='P' and number > 0 andnumber <= (datepart(day, @EndDate) - datepart(day,@StartDate))) as b |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|