
Signature
Dave Hargis, Microsoft Access MVP
Almost, but not quite.
The statement returns values between 7 and 9 or between 5.5 and 9. I'm
looking to get the records from 5.5 to 7, or from 8 to 9. By changing the
statement slightly, I get better results but still not perfect:
Between IIf([Forms]![frmRunTrackModelQuery]![fraDistance]=1,5.5,8) And
IIf([Forms]![frmRunTrackModelQuery]=1,7,9)
This returns the records between 8 and 9 correctly, but the True part
returns all records from 5.5 to 9.
> BETWEEN IIf([Forms]![frmRunTrackModelQuery]![fraDistance]=1, 5.5, 7) AND
> IIf(Forms!frmRunTrackModelQuery=1, 8, 9)
[quoted text clipped - 20 lines]
> >
> > Kevin
Klatuu - 24 Jul 2007 16:54 GMT
Between IIf([Forms]![frmRunTrackModelQuery]![fraDistance]=1,5.5,8) And
IIf([Forms]![frmRunTrackModelQuery]=1,7,9)
Shouldn't both comparisons be the same?
[Forms]![frmRunTrackModelQuery]![fraDistance]
[Forms]![frmRunTrackModelQuery]

Signature
Dave Hargis, Microsoft Access MVP
> Almost, but not quite.
>
[quoted text clipped - 32 lines]
> > >
> > > Kevin
Kevin - 24 Jul 2007 17:10 GMT
Yep. That's got it. Many thanks.
Kevin
> Between IIf([Forms]![frmRunTrackModelQuery]![fraDistance]=1,5.5,8) And
> IIf([Forms]![frmRunTrackModelQuery]=1,7,9)
[quoted text clipped - 41 lines]
> > > >
> > > > Kevin
Dale Fye - 24 Jul 2007 17:06 GMT
Kevin,
If the field contains decimal values, then you could be missing quite a few
buy setting your ranges between 5.5 and 7 or between 8 and 9. What about the
values between 7 and 8?
Dale

Signature
Email address is not valid.
Please reply to newsgroup only.
> Almost, but not quite.
>
[quoted text clipped - 32 lines]
> > >
> > > Kevin
Klatuu - 24 Jul 2007 17:12 GMT
Good catch, Dale. Excellent question.

Signature
Dave Hargis, Microsoft Access MVP
> Kevin,
>
[quoted text clipped - 40 lines]
> > > >
> > > > Kevin