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 |
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2007-07-12 : 16:18:20
|
Guys,I need to find out a way to display all dates between current date - getdate() and give date say '2007-07-03'.Is there any way to do this, I tried DATEADD, DATEDIFF, DATEPART doesnt seem to work.Any suggestions and inputs would helpThanks |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-07-12 : 16:29:08
|
Try harder! DateDiff works.Are you using MICROSOFT SQL Server? Have you read Books Online?Peter LarssonHelsingborg, Sweden |
 |
|
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2007-07-12 : 16:34:50
|
Peso,I am trying to get a result where I get dates between getdate() and '2007-07-09' as2007-07-102007-07-11All I get now with DATEDIFF is a number.Any suggestions would helpThanks |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-07-12 : 16:45:48
|
quote: Originally posted by scelamko Peso,I am trying to get a result where I get dates between getdate() and '2007-07-09' as2007-07-102007-07-11
Aha! You want a resultset with all days in the calendar between some date and another date?Look for a function named F_TABLE_DATE written by Michael Valentine Jones. It has everything and some more of what you need and want.Peter LarssonHelsingborg, Sweden |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-07-12 : 16:46:37
|
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519Peter LarssonHelsingborg, Sweden |
 |
|
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2007-07-13 : 13:25:45
|
Thanks Peso that did the trick. |
 |
|
|
|
|
|
|