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 |
|
jeff06
Posting Yak Master
166 Posts |
Posted - 2007-08-28 : 11:40:39
|
| select contractnbr,affcontractnbr,tdd,affrtramount,affturn, pt=datediff(d,afffirstfundingdate,affRTRBalanceZeroDate),ratio=datediff(d,afffirstfundingdate,affRTRBalanceZeroDate)/afftrunfrom #targetfinishedaffdatediff(d,afffirstfundingdate,affRTRBalanceZeroDate) appears two times in this code, Is there a way to make it appear only once?Thx |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-08-28 : 11:48:45
|
| You could turn it into a function or use a derived table, but that would just complicate things.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|
|