Help!

Another Undefined Function

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Setup/Configuration RSS
Next:  how do I combine several access 2007 files into o..  
Author Message
SElgin via AccessMonster.
External


Since: Apr 21, 2009
Posts: 2



PostPosted: Tue Apr 21, 2009 12:10 pm    Post subject: Another Undefined Function
Archived from groups: microsoft>public>access>setupconfig (more info?)

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.

--
Message posted via http://www.accessmonster.com
Back to top
John Spencer MVP
External


Since: Apr 02, 2009
Posts: 28



PostPosted: Tue Apr 21, 2009 12:13 pm    Post subject: Re: Another Undefined Function [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

SElgin via AccessMonster.com wrote:
> 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.
>
Back to top
John Spencer MVP
External


Since: Apr 02, 2009
Posts: 28



PostPosted: Tue Apr 21, 2009 12:17 pm    Post subject: Re: Another Undefined Function [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

SElgin via AccessMonster.com wrote:
> 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.
>
Back to top
SElgin via AccessMonster.
External


Since: Apr 21, 2009
Posts: 2



PostPosted: Tue Apr 21, 2009 1:10 pm    Post subject: Re: Another Undefined Function [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

Steve

John Spencer MVP wrote:
>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.

--
Message posted via http://www.accessmonster.com
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Setup/Configuration All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum