IIf Statement Syntax Help Needed

G

GitarJake

Hello all,

I need an IIf statement that says:

IIf(child's age is =<4, "string 1","string 2")

I have a birthdate field but I am having trouble writing an appropriate IIf
statement.

TIA for all assistance.

Jake
 
V

Van T. Dinh

IIf([DOB] >= DateAdd("yyyy", -4, Date()), "String for <= 4-years old.",
"String for otherwise.")
 
G

GitarJake

Thanks Van, works like a charm!

Where can I learn more about DateAdd, DateDiff and others? Is there a good
book out there for these?

Because the help files don't help me much. It's like they're written in
Latin!

Thanks again,

Jake


Van T. Dinh said:
IIf([DOB] >= DateAdd("yyyy", -4, Date()), "String for <= 4-years old.",
"String for otherwise.")

--
HTH
Van T. Dinh
MVP (Access)



GitarJake said:
Hello all,

I need an IIf statement that says:

IIf(child's age is =<4, "string 1","string 2")

I have a birthdate field but I am having trouble writing an appropriate IIf
statement.

TIA for all assistance.

Jake
 
V

Van T. Dinh

My recommendations:

* For learning VBA: "Beginning Access {YourVersion} VBA"
by Smith & Sussman published by WROX

* For advanced topics & reference: "Access Developer's
Handbook set" by Getz et all published by SYBEX.

HTH
Van T. Dinh
MVP (Access)


-----Original Message-----
Thanks Van, works like a charm!

Where can I learn more about DateAdd, DateDiff and others? Is there a good
book out there for these?

Because the help files don't help me much. It's like they're written in
Latin!

Thanks again,

Jake


"Van T. Dinh"
IIf([DOB] >= DateAdd("yyyy", -4, Date()), "String for <= 4-years old.",
"String for otherwise.")

--
HTH
Van T. Dinh
MVP (Access)



Hello all,

I need an IIf statement that says:

IIf(child's age is =<4, "string 1","string 2")

I have a birthdate field but I am having trouble
writing an appropriate
IIf
statement.

TIA for all assistance.

Jake


.
 

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