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  

IIF statement



 
 
Thread Tools Display Modes
  #1  
Old February 18th, 2010, 08:25 PM posted to microsoft.public.access.queries
jligue via AccessMonster.com
external usenet poster
 
Posts: 6
Default IIF statement

Not entirely sure if the IIF statement is the correct way to go about this, I
have a field on a query that has total pounds of either printed or plain
product. I want to add a column to my query that only adds up the printed
product.
So, if "product type" = printed, then add up a total, is basically what I am
trying to say.
Can you help me with the proper formula?

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201002/1

  #2  
Old February 18th, 2010, 09:15 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default IIF statement


SUM(IIF([Product Type] = "Printed",[Pounds],Null))

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

jligue via AccessMonster.com wrote:
Not entirely sure if the IIF statement is the correct way to go about this, I
have a field on a query that has total pounds of either printed or plain
product. I want to add a column to my query that only adds up the printed
product.
So, if "product type" = printed, then add up a total, is basically what I am
trying to say.
Can you help me with the proper formula?

  #3  
Old February 18th, 2010, 09:17 PM posted to microsoft.public.access.queries
BlairH
external usenet poster
 
Posts: 11
Default IIF statement

How do you know if it is printed or plain?

If that is identified in another field, add a expression field to your query:

PrintedQty: IIF([Type]="Printed",[Qty],0)

Then total PrintedQty

"jligue via AccessMonster.com" wrote:

Not entirely sure if the IIF statement is the correct way to go about this, I
have a field on a query that has total pounds of either printed or plain
product. I want to add a column to my query that only adds up the printed
product.
So, if "product type" = printed, then add up a total, is basically what I am
trying to say.
Can you help me with the proper formula?

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201002/1

.

  #4  
Old February 18th, 2010, 09:31 PM posted to microsoft.public.access.queries
jligue via AccessMonster.com
external usenet poster
 
Posts: 6
Default IIF statement

Product Type is defined as Plain or Printed, so I use that as my base field.
So if that is printed, then I want to count the value that is in the total
pounds field.

BlairH wrote:
How do you know if it is printed or plain?

If that is identified in another field, add a expression field to your query:

PrintedQty: IIF([Type]="Printed",[Qty],0)

Then total PrintedQty

Not entirely sure if the IIF statement is the correct way to go about this, I
have a field on a query that has total pounds of either printed or plain

[quoted text clipped - 3 lines]
trying to say.
Can you help me with the proper formula?


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201002/1

  #5  
Old February 18th, 2010, 09:35 PM posted to microsoft.public.access.queries
jligue via AccessMonster.com
external usenet poster
 
Posts: 6
Default IIF statement

If i need to say "like *printed*" rather than equal to printed, how exactly
does that spell out? Thank you in advance.

jligue wrote:
Not entirely sure if the IIF statement is the correct way to go about this, I
have a field on a query that has total pounds of either printed or plain
product. I want to add a column to my query that only adds up the printed
product.
So, if "product type" = printed, then add up a total, is basically what I am
trying to say.
Can you help me with the proper formula?


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201002/1

 




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 10:37 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.