User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » MS Access query question (using IIF function) Page [1]  
quagmire02
All American
44225 Posts
user info
edit post

seems to me this should work, but i have exactly zero experience running access queries (of which "IIF" is unique to, i believe)...keeps telling them the syntax is wrong, and it might be something obvious, but i don't see it

banana:
IIf(
IIf(
IIf([apple]>[pear],[apple],[pear]) AS fruit1
>
IIf([orange]>[kiwi],[orange],[kiwi]) AS fruit2
,[fruit1],[fruit2]
) AS fruit3
>
[peach],[fruit3],[peach]
)
if it's not obvious, they're trying to compare 5 numbers to get the largest

4/25/2012 3:25:38 PM

BigMan157
no u
103354 Posts
user info
edit post

GO BANANA

4/25/2012 3:49:03 PM

disco_stu
All American
7436 Posts
user info
edit post

Is it the aliasing that's fucking you up?

You had to use banana: to designate the first IIF's alias, would you need to do the same with fruit1, fruit2, and fruit3?

4/25/2012 4:21:21 PM

Wolfmarsh
What?
5975 Posts
user info
edit post

I would think this is a much better way to go:

http://support.microsoft.com/kb/209857

4/25/2012 6:54:24 PM

 Message Boards » Tech Talk » MS Access query question (using IIF function) Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.