IIF statement Help Please!

G

Guest

Can someone please explain to me where I am meaking my mistake. Also, I am
trying to put this expression in a control and I can't save it.

Thanks for your help in advance!


= IIf( [2oz] ="X" and [Date] <0#5/14/2007#,.545,IIf( [2oz] = is Null and
[Date] <#5/14/2007#,.321,IIf( [2oz] = "x" and [Date] >=#05/14/2007#,.459,IIf(
[2oz] = is Null and [Date] >= #05/14/2007#,.334))))
 
D

Douglas J. Steele

[2oz] = is Null is invalid: it should be IsNull([2oz])

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Yula said:
Can someone please explain to me where I am meaking my mistake. Also, I am
trying to put this expression in a control and I can't save it.

Thanks for your help in advance!


= IIf( [2oz] ="X" and [Date] <0#5/14/2007#,.545,IIf( [2oz] = is Null and
[Date] <#5/14/2007#,.321,IIf( [2oz] = "x" and [Date]
=#05/14/2007#,.459,IIf(
[2oz] = is Null and [Date] >= #05/14/2007#,.334))))
 
G

Guest

Douglas Thanks for your advise, but I am still having trouble.
This is how it looks like when I fixed it: What I want to say is that if
there is an X in a bound control and the date is before 5/14/2007 than give
me .545, if no X before 5/14/2007 than give me.321. If there is a x and after
date 5/14/2007, give me .459, otherwise, give me .334. At this point its only
giving me .334 when there is no X (no matter the date) and .459 when there is
an X. Its ignoring the other criteria.

=IIf([2oz]="X" And [Date]<5/14/2007,0.545,IIf(IsNull([2oz]) And
[Date]<5/14/2007,0.321,IIf([2oz]="X" And
[Date]>=5/14/2007,0.459,IIf(IsNull([2oz]) And [Date]>=5/14/2007,0.334))))

Douglas J. Steele said:
[2oz] = is Null is invalid: it should be IsNull([2oz])

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Yula said:
Can someone please explain to me where I am meaking my mistake. Also, I am
trying to put this expression in a control and I can't save it.

Thanks for your help in advance!


= IIf( [2oz] ="X" and [Date] <0#5/14/2007#,.545,IIf( [2oz] = is Null and
[Date] <#5/14/2007#,.321,IIf( [2oz] = "x" and [Date]
=#05/14/2007#,.459,IIf(
[2oz] = is Null and [Date] >= #05/14/2007#,.334))))
 
B

BruceM

Asked and answered in another thread.

Yula said:
Douglas Thanks for your advise, but I am still having trouble.
This is how it looks like when I fixed it: What I want to say is that if
there is an X in a bound control and the date is before 5/14/2007 than
give
me .545, if no X before 5/14/2007 than give me.321. If there is a x and
after
date 5/14/2007, give me .459, otherwise, give me .334. At this point its
only
giving me .334 when there is no X (no matter the date) and .459 when there
is
an X. Its ignoring the other criteria.

=IIf([2oz]="X" And [Date]<5/14/2007,0.545,IIf(IsNull([2oz]) And
[Date]<5/14/2007,0.321,IIf([2oz]="X" And
[Date]>=5/14/2007,0.459,IIf(IsNull([2oz]) And [Date]>=5/14/2007,0.334))))

Douglas J. Steele said:
[2oz] = is Null is invalid: it should be IsNull([2oz])

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Yula said:
Can someone please explain to me where I am meaking my mistake. Also, I
am
trying to put this expression in a control and I can't save it.

Thanks for your help in advance!


= IIf( [2oz] ="X" and [Date] <0#5/14/2007#,.545,IIf( [2oz] = is Null
and
[Date] <#5/14/2007#,.321,IIf( [2oz] = "x" and [Date]
=#05/14/2007#,.459,IIf(
[2oz] = is Null and [Date] >= #05/14/2007#,.334))))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top