|
Posted by Jim Devenish on 06/22/06 14:24
Thanks Razvan. That is what I had done but it seemed cumbersone for
something that is essentially simple.
At least I know what I can and cannot do, now.
Jim
Razvan Socol wrote:
> Hello, Jim
>
> Try something like this:
> SELECT VehicleFinanceID,
> CASE WHEN SalePrice > PurchasePrice THEN 1 ELSE 0 END As isProfit
> FROM VehicleFinance
>
> SQL Server does not support a boolean data type, so you must use some
> convention to represent boolean values (for example: 1=True, 0=False or
> 'Yes'=True, 'No'=False, etc).
>
> A boolean expression can only be used in an IF statement, a WHILE
> statement, a CASE WHEN expression, a WHERE/HAVING clause, etc.
>
> Razvan
Navigation:
[Reply to this message]
|