A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Assigning text response to a value



 
 
Thread Tools Display Modes
  #1  
Old December 10th, 2009, 05:13 PM posted to microsoft.public.access.queries
cowichandave
external usenet poster
 
Posts: 12
Default Assigning text response to a value

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
--
Dave
  #2  
Old December 10th, 2009, 06:33 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Assigning text response to a value

cowichandave wrote:

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 amount0,"Refund","Sale")
in a blank column in query's design view.

--
Marsh
MVP [MS Access]
  #3  
Old December 10th, 2009, 06:56 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Assigning text response to a value

Try this --
Type_Action: IIF(Nz([Money], "Error")1, "Sale", "Refund")

--
Build a little, test a little.


"cowichandave" wrote:

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
--
Dave

  #4  
Old December 11th, 2009, 04:55 AM posted to microsoft.public.access.queries
cowichandave
external usenet poster
 
Posts: 12
Default Assigning text response to a value

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


"Marshall Barton" wrote:

cowichandave wrote:

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 amount0,"Refund","Sale")
in a blank column in query's design view.

--
Marsh
MVP [MS Access]
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.