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 |
|
marcusstar10
Starting Member
14 Posts |
Posted - 2011-03-10 : 08:54:59
|
| Is there anyway too subtract dates like this?select agent_id, datediff(day,activation_date, deactivation_date) as Mission Durations from missionsorder by agent_idthe activation date and deavtivation date are columns with dates recorded in them |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-03-10 : 09:01:07
|
| [code]select mission_id, mission_date, dateadd(mm,2,mission_date) as deadlinefrom missionsorder by mission_id[/code] |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-03-10 : 09:02:55
|
| May be not ? I didn't quite understand your requirement. What I wrote is to simply display the deadline for each mission assuming the deadline is two months from the mission_date.If something else, can you describe it? |
 |
|
|
marcusstar10
Starting Member
14 Posts |
Posted - 2011-03-10 : 09:17:46
|
| Thanks your assistance really helped, i just changed the (mm,2,mission_date)syntax to what i had previously |
 |
|
|
marcusstar10
Starting Member
14 Posts |
Posted - 2011-03-10 : 09:28:31
|
| Is there anyway too subtract dates like this?select agent_id, datediff(day,activation_date, deactivation_date) as Mission Durations from missionsorder by agent_idthe activation date and deavtivation date are columns with dates recorded in them |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-03-10 : 09:58:59
|
quote: Originally posted by marcusstar10 Is there anyway too subtract dates like this?select agent_id, datediff(day,activation_date, deactivation_date) as Mission Durations from missionsorder by agent_idthe activation date and deavtivation date are columns with dates recorded in them
You are asking answer for the same question. Didn't previous answer help you? Post some sample data with expected resultMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|