Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesI want to execute something like select iif(type='credit',am ount*-1,amount) from table how can i do that? help file says iif is used in Multidimensional Expressions but that seems overly complicated for this task. any ideas?
Post Follow-up to this messageDima Gofman (dg@cfa-solutions.com) writes: > I want to execute something like > > select iif(type='credit',am ount*-1,amount) from table > > how can i do that? help file says iif is used in Multidimensional > Expressions but that seems overly complicated for this task. SELECT CASE type WHEN 'credit' THEN -1 ELSE 1 END * amount See further the CASE expression in Books Online. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techin.../2000/books.asp
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread