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 |
|
JDrown
Starting Member
10 Posts |
Posted - 2005-09-05 : 09:51:41
|
| In Microsoft Access, one can create an expression in a column, i.e.Trial_Expression: ([Column_X] = [Column_Y])And Microsoft Access will return a True/False value back. Now how in the world can I compare two columns of the same datatype and have SQL Server return back a True/False value?I've tried several things, all of which have failed.I have created a simple User-Defined function, which does work, but there should be a way for T-SQL to handle simple comparasions.PLEASE HELP!!!Thanks to all who reply! |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-05 : 09:58:34
|
| Use CaseSelect Case when ([Column_X] = [Column_Y]) then 'True' else 'False' Endfrom yourTableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|