Formula Not Working

S

Schwimms

Hi,

Simple question, this formula is not working:

Status: IIf([cond constr ECD]<1/1/2008,"Backlog",IIf([cond constr
ECD]<1/1/2009,"Current","Future"))

It gives me future for everything.
 
J

Jeff C

--
Jeff C
Live Well .. Be Happy In All You Do


Schwimms said:
Hi,

Simple question, this formula is not working:

Status: IIf([cond constr ECD]<1/1/2008,"Backlog",IIf([cond constr
ECD]<1/1/2009,"Current","Future"))

It gives me future for everything.

Because everything less than 1/1/2008 is also less than 1/1/2009.

for your second condition try > 12/31/2008
 
W

Wayne-I-M

Try this

Status:IIf([TableName]![cond constr
ECD]<#01/01/2008#,"Backlog",IIf([TableName]![cond constr
ECD]<#01/01/2009#,"Current","Future"))


--
Wayne
Manchester, England.
 
W

Wayne-I-M

But the 1st "test" has failed so the result will still stand for the 2nd
option (true / false)


--
Wayne
Manchester, England.



Jeff C said:
--
Jeff C
Live Well .. Be Happy In All You Do


Schwimms said:
Hi,

Simple question, this formula is not working:

Status: IIf([cond constr ECD]<1/1/2008,"Backlog",IIf([cond constr
ECD]<1/1/2009,"Current","Future"))

It gives me future for everything.

Because everything less than 1/1/2008 is also less than 1/1/2009.

for your second condition try > 12/31/2008
 
T

Tom van Stiphout

On Fri, 21 Mar 2008 11:02:01 -0700, Schwimms

Put #-signs around the dates.

In order not to have to rewrite the code next year, you may want to
write something a bit more powerful, like this:
iif(Year(someField)<Year(Date),"Backlog" 'etc.

-Tom.
 
S

Schwimms

Please elaborate! I did think about the fact that I will have to change code
next year.

Tom van Stiphout said:
On Fri, 21 Mar 2008 11:02:01 -0700, Schwimms

Put #-signs around the dates.

In order not to have to rewrite the code next year, you may want to
write something a bit more powerful, like this:
iif(Year(someField)<Year(Date),"Backlog" 'etc.

-Tom.

Hi,

Simple question, this formula is not working:

Status: IIf([cond constr ECD]<1/1/2008,"Backlog",IIf([cond constr
ECD]<1/1/2009,"Current","Future"))

It gives me future for everything.
 
R

Rick Brandt

Schwimms said:
Please elaborate! I did think about the fact that I will have to
change code next year.

This will work for every year without needing to change it...

Status: IIf([cond constr ECD] < DateSerial(Year(Date()),1,1), "Backlog",
IIf([cond constr ECD] < DateSerial(Year(Date())+1,1,1) ,"Current","Future"))
 
Top