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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternative to the IIF 1

Status
Not open for further replies.

kopy

Technical User
May 30, 2002
141
US
Hi, I'm trying to create criteria for a query. I started using an Imediate If statement. But now I realize that since the field I'm trying to set the criteria for([tblAdmissionsTallySheet].[MonthNumber]) is numeric and the result of an Immediate If needs to be a string that I need to find an laternative approach.

An ideas will be greatly appreciated. The IIf I wrote is below.

IIf(Month(Date())<=6,([tblAdmissionsTallySheet].[MonthNumber]) Between 1 And Month(Date())+6,([tblAdmissionsTallySheet].[MonthNumber]) Between 1 And Month(Date())-6)

Thanks in advance for your help,

Kopy
 
And this (in criteria cell of MonthNumber) ?
Between 1 And Month(Date()) + IIf(Month(Date())<=6, 6, -6)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top