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 |
|
rkalyani
Starting Member
30 Posts |
Posted - 2009-07-01 : 14:19:32
|
| I have a calcuated field in my query like this (Myfn.DateDiffWeekdays(dbo.startdate, dbo.endDate))as turnaround_timeNow I need to take this field and do a case on it. I am trying something like this case when app_id = 0 then turnraound_time else '0' End as PaperTurnAroundTimeBut I get an error Invalid column name 'turnraound_time'.Is there a way around this?Thank you,kal30 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-07-01 : 14:24:33
|
you can use it like thisSELECT other columns, case when app_id = 0 then turnraound_time else '0' End as PaperTurnAroundTimeFROM(Your current query with (Myfn.DateDiffWeekdays(dbo.startdate, dbo.endDate))as turnaround_time)t |
 |
|
|
rkalyani
Starting Member
30 Posts |
Posted - 2009-07-01 : 15:42:19
|
| Thank you. I was able to get it to work.Thank you,kal30 |
 |
|
|
|
|
|