PC Review


Reply
Thread Tools Rate Thread

Between...And operator

 
 
=?Utf-8?B?SXJlbmUgU0dB?=
Guest
Posts: n/a
 
      13th Nov 2006
I've been using the Between...And operator for a calculated field:

pass or fail: IIf([Average Actual Value] Between ([Nominal]+[-Lower
Tolerance]) And ([Nominal]+[+Upper Tolerance]),"Pass","Fail")

The Average Actual Value (AAV) is an average of 4 values. The problem comes
when the AAV= either the upper or lower limit. I get inconsistencies,
sometimes it passes and sometimes it fails.
any ideas on what I'm doing wrong?
 
Reply With Quote
 
 
 
 
Jeff Boyce
Guest
Posts: n/a
 
      13th Nov 2006
Irene

You may need to be more explicit with your "between". You could use ">="
(lower) and "<=" (upper) instead of Between... And...

Regards

Jeff Boyce
Microsoft Office/Access MVP


"Irene SGA" <Irene (E-Mail Removed)> wrote in message
news:79EBAFD2-ECF4-4BFB-9CE7-(E-Mail Removed)...
> I've been using the Between...And operator for a calculated field:
>
> pass or fail: IIf([Average Actual Value] Between ([Nominal]+[-Lower
> Tolerance]) And ([Nominal]+[+Upper Tolerance]),"Pass","Fail")
>
> The Average Actual Value (AAV) is an average of 4 values. The problem
> comes
> when the AAV= either the upper or lower limit. I get inconsistencies,
> sometimes it passes and sometimes it fails.
> any ideas on what I'm doing wrong?



 
Reply With Quote
 
=?Utf-8?B?SXJlbmUgU0dB?=
Guest
Posts: n/a
 
      13th Nov 2006
Thanks Jeff,

I tried:

pass or fail: IIf([Average Actual Value]<=[USL] And [Average Actual
Value]>=[LSL],"Pass","Fail")

where,
USL=[Nominal]+[+Upper Tolerance]
LSL=[Nominal]+[-Lower Tolerance]

I get the same error. Note that it doesn't happen every time, just sometimes
but they don't make any sense.

Regards,
Irene

"Jeff Boyce" wrote:

> Irene
>
> You may need to be more explicit with your "between". You could use ">="
> (lower) and "<=" (upper) instead of Between... And...
>
> Regards
>
> Jeff Boyce
> Microsoft Office/Access MVP
>
>
> "Irene SGA" <Irene (E-Mail Removed)> wrote in message
> news:79EBAFD2-ECF4-4BFB-9CE7-(E-Mail Removed)...
> > I've been using the Between...And operator for a calculated field:
> >
> > pass or fail: IIf([Average Actual Value] Between ([Nominal]+[-Lower
> > Tolerance]) And ([Nominal]+[+Upper Tolerance]),"Pass","Fail")
> >
> > The Average Actual Value (AAV) is an average of 4 values. The problem
> > comes
> > when the AAV= either the upper or lower limit. I get inconsistencies,
> > sometimes it passes and sometimes it fails.
> > any ideas on what I'm doing wrong?

>
>
>

 
Reply With Quote
 
Jeff Boyce
Guest
Posts: n/a
 
      13th Nov 2006
My next guess would be that there are "missing values" (perhaps "nulls") for
some of the components.

Do you wish to exclude any records with Null values in any of the
components, or do you want to convert those null values?

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Irene SGA" <(E-Mail Removed)> wrote in message
news:58606595-5703-4D78-944B-(E-Mail Removed)...
> Thanks Jeff,
>
> I tried:
>
> pass or fail: IIf([Average Actual Value]<=[USL] And [Average Actual
> Value]>=[LSL],"Pass","Fail")
>
> where,
> USL=[Nominal]+[+Upper Tolerance]
> LSL=[Nominal]+[-Lower Tolerance]
>
> I get the same error. Note that it doesn't happen every time, just
> sometimes
> but they don't make any sense.
>
> Regards,
> Irene
>
> "Jeff Boyce" wrote:
>
>> Irene
>>
>> You may need to be more explicit with your "between". You could use ">="
>> (lower) and "<=" (upper) instead of Between... And...
>>
>> Regards
>>
>> Jeff Boyce
>> Microsoft Office/Access MVP
>>
>>
>> "Irene SGA" <Irene (E-Mail Removed)> wrote in message
>> news:79EBAFD2-ECF4-4BFB-9CE7-(E-Mail Removed)...
>> > I've been using the Between...And operator for a calculated field:
>> >
>> > pass or fail: IIf([Average Actual Value] Between ([Nominal]+[-Lower
>> > Tolerance]) And ([Nominal]+[+Upper Tolerance]),"Pass","Fail")
>> >
>> > The Average Actual Value (AAV) is an average of 4 values. The problem
>> > comes
>> > when the AAV= either the upper or lower limit. I get inconsistencies,
>> > sometimes it passes and sometimes it fails.
>> > any ideas on what I'm doing wrong?

>>
>>
>>



 
Reply With Quote
 
David F Cox
Guest
Posts: n/a
 
      13th Nov 2006
Is it possible that it only appears to fail, that the result displays with
less precision that the value actually has?


"Irene SGA" <Irene (E-Mail Removed)> wrote in message
news:79EBAFD2-ECF4-4BFB-9CE7-(E-Mail Removed)...
> I've been using the Between...And operator for a calculated field:
>
> pass or fail: IIf([Average Actual Value] Between ([Nominal]+[-Lower
> Tolerance]) And ([Nominal]+[+Upper Tolerance]),"Pass","Fail")
>
> The Average Actual Value (AAV) is an average of 4 values. The problem
> comes
> when the AAV= either the upper or lower limit. I get inconsistencies,
> sometimes it passes and sometimes it fails.
> any ideas on what I'm doing wrong?
>



 
Reply With Quote
 
=?Utf-8?B?SXJlbmUgU0dB?=
Guest
Posts: n/a
 
      16th Nov 2006
David,

Yes I think that's the problem. I noticed that when I add zero to any
control, the result is not the control itself, but a different number. Say I
add 0.36+0.0, the result should be 0.36, but it is 0.3599999 or some crazy
number like this, so that's making my data fail. What can I do?

Thanks

"David F Cox" wrote:

> Is it possible that it only appears to fail, that the result displays with
> less precision that the value actually has?
>
>
> "Irene SGA" <Irene (E-Mail Removed)> wrote in message
> news:79EBAFD2-ECF4-4BFB-9CE7-(E-Mail Removed)...
> > I've been using the Between...And operator for a calculated field:
> >
> > pass or fail: IIf([Average Actual Value] Between ([Nominal]+[-Lower
> > Tolerance]) And ([Nominal]+[+Upper Tolerance]),"Pass","Fail")
> >
> > The Average Actual Value (AAV) is an average of 4 values. The problem
> > comes
> > when the AAV= either the upper or lower limit. I get inconsistencies,
> > sometimes it passes and sometimes it fails.
> > any ideas on what I'm doing wrong?
> >

>
>
>

 
Reply With Quote
 
Lynn Trapp
Guest
Posts: n/a
 
      16th Nov 2006
Irene,
Your problem is related to the nature of Double precision numbers. If you
are able to work with a maximum of 4 decimal places, you can change your
datatype to Currency and the problem should go away.

--

Lynn Trapp
Microsoft MVP (Access)
www.ltcomputerdesigns.com


"Irene SGA" <(E-Mail Removed)> wrote in message
news:687A6976-6FC9-425F-B8F5-(E-Mail Removed)...
> David,
>
> Yes I think that's the problem. I noticed that when I add zero to any
> control, the result is not the control itself, but a different number. Say
> I
> add 0.36+0.0, the result should be 0.36, but it is 0.3599999 or some crazy
> number like this, so that's making my data fail. What can I do?
>
> Thanks
>
> "David F Cox" wrote:
>
>> Is it possible that it only appears to fail, that the result displays
>> with
>> less precision that the value actually has?
>>
>>
>> "Irene SGA" <Irene (E-Mail Removed)> wrote in message
>> news:79EBAFD2-ECF4-4BFB-9CE7-(E-Mail Removed)...
>> > I've been using the Between...And operator for a calculated field:
>> >
>> > pass or fail: IIf([Average Actual Value] Between ([Nominal]+[-Lower
>> > Tolerance]) And ([Nominal]+[+Upper Tolerance]),"Pass","Fail")
>> >
>> > The Average Actual Value (AAV) is an average of 4 values. The problem
>> > comes
>> > when the AAV= either the upper or lower limit. I get inconsistencies,
>> > sometimes it passes and sometimes it fails.
>> > any ideas on what I'm doing wrong?
>> >

>>
>>
>>



 
Reply With Quote
 
Jeff Boyce
Guest
Posts: n/a
 
      16th Nov 2006
Irene

From the "symptom", I suspect the data type for this field is Single or
Double. These are, I believe, stored as binary values, so there's rounding
issues.

If you need no more than four decimal places, use the Currency datatype
instead -- I don't believe this is stored as binary, so .36 + 0 = .36

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Irene SGA" <(E-Mail Removed)> wrote in message
news:687A6976-6FC9-425F-B8F5-(E-Mail Removed)...
> David,
>
> Yes I think that's the problem. I noticed that when I add zero to any
> control, the result is not the control itself, but a different number. Say
> I
> add 0.36+0.0, the result should be 0.36, but it is 0.3599999 or some crazy
> number like this, so that's making my data fail. What can I do?
>
> Thanks
>
> "David F Cox" wrote:
>
>> Is it possible that it only appears to fail, that the result displays
>> with
>> less precision that the value actually has?
>>
>>
>> "Irene SGA" <Irene (E-Mail Removed)> wrote in message
>> news:79EBAFD2-ECF4-4BFB-9CE7-(E-Mail Removed)...
>> > I've been using the Between...And operator for a calculated field:
>> >
>> > pass or fail: IIf([Average Actual Value] Between ([Nominal]+[-Lower
>> > Tolerance]) And ([Nominal]+[+Upper Tolerance]),"Pass","Fail")
>> >
>> > The Average Actual Value (AAV) is an average of 4 values. The problem
>> > comes
>> > when the AAV= either the upper or lower limit. I get inconsistencies,
>> > sometimes it passes and sometimes it fails.
>> > any ideas on what I'm doing wrong?
>> >

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
about & operator 2008rasko@gmail.com Microsoft Excel Misc 2 12th Dec 2008 04:44 PM
generic problem with operator. compile error: operator * is not allowedon type T. SharpKnight Microsoft C# .NET 2 20th Feb 2006 01:08 PM
The Bang ! operator vs the . operator... Rashar Sharro via AccessMonster.com Microsoft Access Form Coding 10 16th Jun 2005 09:05 PM
Using LIKE operator in VBA JMB Microsoft Access Queries 1 17th Feb 2004 08:07 PM
C# exponentiation operator & operator overloading David Laub Microsoft C# .NET 2 20th Dec 2003 09:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:21 AM.