how do i make a query format only if certain criteria are met?

rovolution2

Registered User.
Local time
Today, 01:50
Joined
Jul 29, 2008
Messages
20
I want to make a query only do formatting if a certain set of criteria are met (field value does not equal 0 or null).

Can i do this after i type the SELECT statement, such as:

SELECT IIf([Field] = 0 OR [Field] IS NULL, [Field] AS [FieldRep], Format([Field] AS [FieldRep], '0.00%')) FROM table;



Is a statement like the above possible? Thanks
 
SELECT IIf(([Field] = 0 OR ISNULL[Field]) , [Field] AS [FieldRep], Format([Field] AS [FieldRep], '0.00%')) FROM table;
 
Sorry Pat I overlooked that part of the statement
 

Users who are viewing this thread

Back
Top Bottom