Re: IFF Statement

Tech-Archive recommends: Fix windows errors by optimizing your registry



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


"Gloria" <Gloria@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:51C80CE5-408C-4171-8FF3-08F6289061D0@xxxxxxxxxxxxxxxx
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?


.



Relevant Pages

  • Re: adding formula
    ... "&" will concatenate the two. ... In formulas every character must be exact. ... It is a simple matter of writing an IIF statement. ...
    (microsoft.public.project)
  • Re: Zounds - it works!
    ... values in an IIf statement also evaluate to either 0 or -1, ... >> I don't understand how an equation, as such, produces a criteria value ... >> I was trying to do it with a conditional IIf statement, ... >> a specific string, a series of strings, or some string formula like Left ...
    (microsoft.public.access.queries)
  • Re: Multiple IIF in Query for Report
    ... This takes into account the different ways that & or + work when adding together strings. ... > In my report I have one field in which I want to concatenate the full name. ... > Here is my current IIF statement for the field in my report: ...
    (microsoft.public.access.reports)
  • Re: Address Label Problem
    ... Using the IIF statement made it work. ... This uses the fact that when you concatenate strings using the + sign you ... If there is no address2 I get a blank line. ...
    (microsoft.public.access.reports)