| Author |
Topic  |
|
|
rama.nelluru
Starting Member
USA
35 Posts |
Posted - 10/27/2011 : 21:33:40
|
Hi ,
I need to write a script that updates the date columns.
My requirement is
I have date column
Col name-----Datecol 01-10-2010 01-17-2010 01-24-2010.......with a week diffrnce
I need to update 01-10-2010 with the 04-06-2010 01-10-2010 with the 04-13-2010( a week diffrence hear)
so finally the first date(01-10-2010) must be update with 04-06-2010...a week diffrnce in both the dates.... I need to channge like 12 weeks like that.
Please help me on this....
RAM |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
48012 Posts |
|
|
rama.nelluru
Starting Member
USA
35 Posts |
Posted - 10/28/2011 : 08:36:52
|
I have table with column name datecol data ------- 01-10-2010 01-17-2010 01-24-2010
and in other table or same table i have datecolumn with data 04-10-2012 04-17-2012 04-24-2012
I want update if 01-10-2010 was the date i need to update with 04-10-2012 if 01-17-2010 was the date i need to update with 04-10-2012 like that i need to update foe 10 continous weeks.
Please some one can help me to write a script that updates the date with 1 week diffrence in the tables column.
RAM |
Edited by - rama.nelluru on 10/28/2011 08:38:45 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
48012 Posts |
Posted - 10/28/2011 : 08:42:34
|
one question. how do you determine which date in your first table needs to replaced by which date in other table? do you have a common field with which you can relate them?
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
rama.nelluru
Starting Member
USA
35 Posts |
Posted - 10/28/2011 : 11:46:37
|
common field is weekid. How do I update the teh date. Please any someone can help me out the script
RAM |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
48012 Posts |
Posted - 10/28/2011 : 12:27:03
|
quote: Originally posted by rama.nelluru
common field is weekid. How do I update the teh date. Please any someone can help me out the script
RAM
can we see what update query you tried and what was issue you faced with it?
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
| |
Topic  |
|