Assigning text response to a value

C

cowichandave

In quering a sales database, if the sales amount is positive how do I get the
query to add "Sale" in another field or if the sales is negative have it add
"Refund" in the another field
 
M

Marshall Barton

cowichandave said:
In quering a sales database, if the sales amount is positive how do I get the
query to add "Sale" in another field or if the sales is negative have it add
"Refund" in the another field


Try adding a calculated field to the query. Just put an
expression like:
IIf([sales amount<0,"Refund","Sale")
in a blank column in query's design view.
 
C

cowichandave

Thank you both. I used Marshalls simpler answer and it works very well.
--
CowichanDave


Marshall Barton said:
cowichandave said:
In quering a sales database, if the sales amount is positive how do I get the
query to add "Sale" in another field or if the sales is negative have it add
"Refund" in the another field


Try adding a calculated field to the query. Just put an
expression like:
IIf([sales amount<0,"Refund","Sale")
in a blank column in query's design view.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top