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 |
|
Sambhav
Starting Member
31 Posts |
Posted - 2007-07-18 : 15:48:40
|
| I have two tables incidents and prodwin .I have prodrecddt (datetimecolumn) in prodwin table which I have to update and it should be updated such that it should be greater than initdt and less than invcompleteddt which are in incidents table.Right now my prodrecddt is same as initdt.My date diff between initdt and invcompleteddt is from 3- 28 days I thought of increasing the prodrecdt plus one and then updating it like this but it wont work this way UPDATE prodwinSET prodrecddt = invcompleteddt -DATEPART(hour, invcompleteddt)%5 + 1is there any way i can use WHERE field so that i can say where datediff is more than 5 Thanks a lot in advance |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-07-18 : 16:08:11
|
| You need to do a better job of explaining what you are trying to.It would also be helpful if you provided your table structures, some sample data, and what you want the results to look like.CODO ERGO SUM |
 |
|
|
|
|
|