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 |
|
macca
Posting Yak Master
146 Posts |
Posted - 2011-12-05 : 09:45:11
|
| I am selecting column Days_On_App from tblT and adding 28 days to that as totdays. I then want to add the totdays to start_date depending on what Tno is.SELECT DATEADD(Day, Days_On_App + 28, 'start_date') AS FutureDateFROM tblTWHERE(TNo = '1234')Anyone know how to do this?Thanks. |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-12-05 : 09:53:48
|
| Not sure what you want.What is start_date - it looks like a literal rather than a date.==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
macca
Posting Yak Master
146 Posts |
Posted - 2011-12-05 : 10:06:19
|
| start_date is a date in the DB.Days_On_App is a intWhat I want is to SELECT Days_On_App and add 28 to it then to add the total of (Days_On_App + 28) to start_date and this wil then give me a date over 28 days in teh future from start_date.Thanks. |
 |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-12-05 : 10:12:01
|
| SELECT DATEADD(dd, Days_On_App + 28, start_date) AS FutureDateFROM tblTor justselect start_date + Days_On_App + 28 AS FutureDateFROM tblT==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
macca
Posting Yak Master
146 Posts |
Posted - 2011-12-05 : 11:03:09
|
| Thanks Nigel.That worked. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|