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 |
|
Sambasivam
Starting Member
36 Posts |
Posted - 2009-07-28 : 15:07:07
|
| I have a field (date time). I need to extract weekly rows from the table using the date time field starting with least date in the table.For Example if the field has these data2000-12-062000-12-062000-12-062000-12-062000-12-062000-12-062000-12-072000-12-072000-12-072000-12-072000-12-072000-12-072000-12-072000-12-072000-12-072000-12-072000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-082000-12-112000-12-112000-12-112000-12-112000-12-112000-12-112000-12-112000-12-112000-12-112000-12-112000-12-112000-12-112000-12-112000-12-122000-12-122000-12-122000-12-122000-12-122000-12-122000-12-122000-12-122000-12-122000-12-122000-12-122000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-132000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-142000-12-152000-12-152000-12-152000-12-162000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-182000-12-192000-12-192000-12-192000-12-192000-12-19the query should fetch 2000-12-06 and row with one week later from hereand then next date to week later.Please help me with some ideas |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2009-07-28 : 16:36:36
|
like this?SELECT MIN(Field), DATEADD(WEEK, 1 MIN(Field))FROM MyTableGROUP BY Field |
 |
|
|
Sambasivam
Starting Member
36 Posts |
Posted - 2009-07-28 : 17:20:28
|
| I want it like thisCol1 Col22000-12-06 2000-12-122000-12-13 2000-12-192000-12-20 2000-12-26and so on |
 |
|
|
Sambasivam
Starting Member
36 Posts |
Posted - 2009-07-29 : 10:54:32
|
| Isn't there anyone who can give some help for this. Does it mean that it is not possible to do so? |
 |
|
|
|
|
|