Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help w/simple IIF 1

Status
Not open for further replies.

dceglar2

Technical User
Feb 23, 2005
7
US
What is wrong with the following:

IIf (date() = (between 08/01/2004 And 07/31/2005),"School Year 2004/2005")

I just want to see if the current date follows in a certain School Year range, and if so, print "School Year 2004/2005". I want to string/nest a few together to check for the next few school years. I am using this in a report header. My expression produces nothing when I view the page.

Thanks!
 
Firstly, date fields have to be enclosed within hash symbols.
Secondly, there is no need to have = and Between in the same condition.
Thirdly, an Iif statement needs something to put up if the condition is false.
so the simple modifications below should fix the problem:

Code:
IIf (date() between #08/01/2004# And #07/31/2005#,"School Year 2004/2005", "")

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top