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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
using the IIF
i am having trouble with getting the statement to work like i need:
IIf([REFUND_LETTERS_ALL_COUNT].Counter=1,"First Request","Second Request ") AS Expr1 What I need to do is nest this statement so that the result will show Counter = 0, blank Counter= 1, “First Request” Counter = 2, “Second Request” Etc…. As of now, it returns "Second Request for all records. |
#2
|
|||
|
|||
using the IIF
On Fri, 21 Mar 2008 10:09:01 -0700, ACSer wrote:
i am having trouble with getting the statement to work like i need: IIf([REFUND_LETTERS_ALL_COUNT].Counter=1,"First Request","Second Request ") AS Expr1 What I need to do is nest this statement so that the result will show Counter = 0, blank Counter= 1, First Request Counter = 2, Second Request EtcK. As of now, it returns "Second Request for all records. Here is the syntax to nest iif statements. IIf(Criteria=A,TrueValueA,IIf(Criteria=B,TrueValue B,FalseValue)) so using your values: IIf([REFUND_LETTERS_ALL_COUNT].Counter=1,"First Request", IIf([REFUND_LETTERS_ALL_COUNT].Counter=2,"Second Request,"")) AS Expr1 However I don't like the sound of that Etc... you placed at the end. If you have a lot of choices there are better functions to use. Look up Choose(), and Select Case in VBA Help. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#3
|
|||
|
|||
using the IIF
i had attempted to use the case statement originally and it bombed...
i used this and with the syntax error corrected, gave me the result needed, however i am still showing duplicate records for these requests, got any ideas to stop the duplication? if the letter "fredg" wrote: On Fri, 21 Mar 2008 10:09:01 -0700, ACSer wrote: i am having trouble with getting the statement to work like i need: IIf([REFUND_LETTERS_ALL_COUNT].Counter=1,"First Request","Second Request ") AS Expr1 What I need to do is nest this statement so that the result will show Counter = 0, blank Counter= 1, “First Request” Counter = 2, “Second Request” Etc…. As of now, it returns "Second Request for all records. Here is the syntax to nest iif statements. IIf(Criteria=A,TrueValueA,IIf(Criteria=B,TrueValue B,FalseValue)) so using your values: IIf([REFUND_LETTERS_ALL_COUNT].Counter=1,"First Request", IIf([REFUND_LETTERS_ALL_COUNT].Counter=2,"Second Request,"")) AS Expr1 However I don't like the sound of that Etc... you placed at the end. If you have a lot of choices there are better functions to use. Look up Choose(), and Select Case in VBA Help. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#4
|
|||
|
|||
using the IIF
On Fri, 21 Mar 2008 12:07:03 -0700, ACSer
wrote: i had attempted to use the case statement originally and it bombed... i used this and with the syntax error corrected, gave me the result needed, however i am still showing duplicate records for these requests, got any ideas to stop the duplication? Sounds like a different problem with the query; please open the query in SQL view and post it here. An example of what kind of "duplicate" you're seeing might help too. -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|