Another Undefined Function

  • Thread starter SElgin via AccessMonster.com
  • Start date
S

SElgin via AccessMonster.com

I have the following query that gives me the Undefined Function 'Iff"

SELECT tblStudent.StuLastName, tblStudent.StuFirstName, tblStudent.StuMI,
tblStudent.StuDOB, Iff(IsNull([tblStudent.StuDOB]),0,-1) AS MyTest
FROM tblStudent;

I have checked the references and none are missing. I have added and deleted
a reference and that did not help either.

What I am trying to do is check a date field and if it is empty get a 0 I can
put on a report in a check box, otherwise I want a -1 for the same reason.

TIA for the help.
 
J

John Spencer MVP

The function is IIF not IFF.

I always think of it as *I*mmediate *IF*

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
J

John Spencer MVP

Whoops! I answered why IFF failed when you need to use IIF. I failed to
mention that
[tblStudent.StuDOB]
should by
[tblStudent].[StuDOB]

I should have said if all you need is to return True (-1) or False (0) then
you can use the expression
tblStudent.StuDOB Is Not Null

SELECT tblStudent.StuLastName
, tblStudent.StuFirstName
, tblStudent.StuMI
, tblStudent.StuDOB
, tblStudent.StuDOB Is Not Null AS MyTest
FROM tblStudent;

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
S

SElgin via AccessMonster.com

Thank you John for settine me straight on IIF. :)
Thanks also for the code without the IIF.

Steve
The function is IIF not IFF.

I always think of it as *I*mmediate *IF*

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I have the following query that gives me the Undefined Function 'Iff"
[quoted text clipped - 9 lines]
TIA for the help.
 
Top