|
Posted by Erland Sommarskog on 02/20/07 22:57
Jorgen [DK/2600] (nyhedsgruppe_hejhej_@gmail.com) writes:
> Ah.. this one is actually a bit more complex.
>
> My problem is that in a amount field I have both % and Quantity mixed
> together. So the formula should check the "format" column for the amount
> field, if the format columns contains "%" it return the value - if not, i
> writes zero in my expression.
SELECT CASE format WHEN '%' THEN amount ELSE 0 END
I don't know if this fits your bill. But if it does not, please post:
o CREATE TABLE statement for your table(s)
o INSERT statements with sample data.
o The desired result given the sample.
This helps to clarify what you are looking for, and makes it easy to copy
and paste to develop a tested solution.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|