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 |
|
sqlspider
Starting Member
16 Posts |
Posted - 2005-08-25 : 10:17:21
|
| Is there a way I can frame the querry for the following scenario??column1--------item1item2item3.....Querry: Select datediff(month,item1,item2) and next for item2 and item3...Thanks |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-25 : 10:26:39
|
| Try thisSelect 'Select DateDiff(D,'+cast(t1.column1 as varchar)+','+ cast(t2.column1 as varchar)+')' from yourTable t1 inner join yourTable t2 on t1.column1>t2.colum1MadhivananFailing to plan is Planning to fail |
 |
|
|
sqlspider
Starting Member
16 Posts |
Posted - 2005-08-25 : 10:59:49
|
| Hi Madhivanan I am getting an syntax error converting datetime from charecter string...I also do not wish to have two tables. Is there any way I could iterate the row values in the same column to get a datediff??thank you for your input.Vik |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-26 : 00:42:54
|
| I think the query I suggested will workPost the table structure and provide some sample dataMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|