[AccessD] My Iif expression isn't right

Robin Robin at rolledgold.net
Tue Aug 15 10:49:59 CDT 2006


Tina,
Try taking the quotes out around True - it's not a string value..
Rgds
Robin Lawrence


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tina Norris
Fields
Sent: 15 August 2006 17:02
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] My Iif expression isn't right


Hi again,

Okay, I think I've got the solution - use the -1 value instead of "Yes" 
for the criteria - that makes my IEP-Sort field get the number I want.

But, why doesn't the other way around work? 

Tina

Tina Norris Fields wrote:
> Hi all,
>
> Well, you helped me yesterday with my tab control background color 
> issue.
>
> I've got another one to solve pronto.
>
> My client wanted three yes/no checkboxes for each student, labeled
> IEP-10, IEP-11, and IEP-12 - these were to indicate whether an IEP 
> evaluation had been carried out for the student and in which grade,
10, 
> 11, or 12.  At the time, I was assured this was never going to be used

> for sorting.  Riiiiight!  So, there are three separate fields in the 
> student table. 
>
> Now, we need to create a report showing all students for whom the IEP
> has been carried out, and - you guessed it -  sort first on the IEP 
> grade (10, 11, or 12), and then alphabetically by student name.
>
> I decided to add a computed field to my query that looks for a "Yes" 
> in
> any of the three fields, and to give a value to that field based on 
> which IEP field was "Yes" like so:
> IEP-Sort:Iif([IEP-10]="Yes", 10, Iif([IEP-11] = "Yes", 11, 
> Iif([IEP-12]="Yes", 12, "")))
>
> The idea then, is to sort on the computed field.  The query finds the
> records and fills in all the fields correctly except for my IEP-Sort 
> field - there it gives me the #Error.  Okay, I don't know what my
error 
> is.  Please, how do I figure out my goof and fix it?  I will be
watching 
> for a reply and trying to think it out at the same time.  Any help 
> appreciated.
>
> Thanks,
> Tina
>
>
>   
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list