Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Dear all,It work!select Case lang1 when 'Chinese' then 10 else 20 end as abc, lang1spoken, ([ID]*2 + Convert(int, lang1spoken)) from Job_Req_langIt failselect Case lang1 when 'Chinese' then 10 else 20 end as abc, lang1spoken, ([ID]*2 + Convert(int, abc)) from Job_Req_langWhat is the problem?How to solve it?be a hardworking people!!
Kristen
Test
22859 Posts
Posted - 2005-08-17 : 09:03:18
What error are you seeing?What data type is "abc"? Perhaps it does not contain bvalid INTs?Kristen
madhivanan
Premature Yak Congratulator
22864 Posts
Posted - 2005-08-17 : 09:03:33
You need to use derived table
Select abc,([ID]*2 + Convert(int, abc)) from(select [ID],Case lang1 when 'Chinese' then 10 else 20 end as abc, lang1spokenfrom Job_Req_lang) T
MadhivananFailing to plan is Planning to fail
acdacd
Yak Posting Veteran
63 Posts
Posted - 2005-08-17 : 09:20:02
ThxThe problem is that the abc is the orginal col name of table, derived Table solve this problembe a hardworking people!!