Here is the scenario. I have a list of numbers and due dates. I need to
create a query and an IIF statement. The IIF statement has to say:
iif([number list]=**-****1, "12/31/2006")
number list
12-23121
32-12542
42-12541
Than I have due dates:
all numbers ending on "1" due date is 12/31/2006
all numbers ending on "2" due date is 12/31/2007
My question is what wildcard can I use to remplace the "???" on my
expression? Or is there another way to complete my IIF statement?
Rick B - 29 Mar 2006 20:34 GMT
Just use the "Right" function to grab the right digit of a field.
It seems rather odd to use a digit in a number to represent a due date,
though.

Signature
Rick B
> Here is the scenario. I have a list of numbers and due dates. I need to
> create a query and an IIF statement. The IIF statement has to say:
[quoted text clipped - 12 lines]
> My question is what wildcard can I use to remplace the "???" on my
> expression? Or is there another way to complete my IIF statement?
Gloria - 29 Mar 2006 20:55 GMT
Thanks for your help
> Just use the "Right" function to grab the right digit of a field.
>
[quoted text clipped - 17 lines]
> > My question is what wildcard can I use to remplace the "???" on my
> > expression? Or is there another way to complete my IIF statement?
Tom Ellison - 29 Mar 2006 20:37 GMT
Dear Gloria:
Your "number list" contains strings. You want to look at the last
character. Use Right([number list], 1) to get this. Convert that to an
integer like this:
CInt(Right([number list], 1))
Use DateAdd to add this many years to 12/31/2005.
DateAdd("yyyy", CInt(Right("12-99997", 1)), CDate("12/31/2005"))
This yields12/31/2012
Sound good?
Tom Ellison
> Here is the scenario. I have a list of numbers and due dates. I need to
> create a query and an IIF statement. The IIF statement has to say:
[quoted text clipped - 12 lines]
> My question is what wildcard can I use to remplace the "???" on my
> expression? Or is there another way to complete my IIF statement?
Gloria - 29 Mar 2006 20:55 GMT
Thanks for your help
> Dear Gloria:
>
[quoted text clipped - 30 lines]
> > My question is what wildcard can I use to remplace the "???" on my
> > expression? Or is there another way to complete my IIF statement?
mscertified - 29 Mar 2006 20:41 GMT
You could use the RIGHT$ function e.g.
IIF(RIGHT$(CStr(MyNumber),1)="1",...,...)
-Dorian
> Here is the scenario. I have a list of numbers and due dates. I need to
> create a query and an IIF statement. The IIF statement has to say:
[quoted text clipped - 12 lines]
> My question is what wildcard can I use to remplace the "???" on my
> expression? Or is there another way to complete my IIF statement?
Gloria - 29 Mar 2006 20:55 GMT
Thanks for your help
> You could use the RIGHT$ function e.g.
> IIF(RIGHT$(CStr(MyNumber),1)="1",...,...)
[quoted text clipped - 17 lines]
> > My question is what wildcard can I use to remplace the "???" on my
> > expression? Or is there another way to complete my IIF statement?
Gloria - 29 Mar 2006 21:00 GMT
thanks for your help
> You could use the RIGHT$ function e.g.
> IIF(RIGHT$(CStr(MyNumber),1)="1",...,...)
[quoted text clipped - 17 lines]
> > My question is what wildcard can I use to remplace the "???" on my
> > expression? Or is there another way to complete my IIF statement?