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

IIF and IsNull for Date Completed Query

Status
Not open for further replies.

azalealee

Programmer
Nov 21, 2002
36
AU
Hi!

I'm having problems with designing a query in design view. I have a Date_Completed field from a table that will have a value when a task is complete, and have no value if the task is outstanding.

I want the query to show all Completed tasks when the option group on my form =1 and show all outstanding tasks when the option group=2.

This is my expression in the criteria of the Date_Completed field:
IIf([Forms]![F_ReportsMenu]![Filter_Op_Group]=1, IsNull, Not IsNull)

It doesn't want to work for me and I was wondering if there was a better way to do it.

Thanks for your help in advance.
 
Hi

([Forms]![F_ReportsMenu]![Filter_Op_Group]=1 AND IsNUll(DateComplete)) OR ([Forms]![F_ReportsMenu]![Filter_Op_Group]<>1 AND Not IsNull(DateComplete)

Assuming you date compete column is called DateComplete

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi Ken

Finally got the thing working from the SQL view of the query using:

SELECT ....
WHERE ((IIF([Forms]![F_ReportsMenu]![Filter_Op_Group]=1, (M_HASIFDB.Date_Completed) is Null, (M_HASIFDB.Date_Completed) is Not Null)))

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top