English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Ok, I'll try you guys. Why does the following work but not othere (in a query)?
Works = IIf([Expr12] Is Null,[Origin],[Expr12])

Does not work = IIf([Destination]=[STN CD],[Profit Center])

or iif( [Destination] = [All Stations]![STN CD], [All Stations]![Profit Center] )

2007-04-19 05:32:26 · 1 answers · asked by Anonymous in Computers & Internet Programming & Design

Sorry everone, these is one that is giving problems:
IIf([Expr10]=[STN CD],[Profit Center])

2007-04-19 06:12:21 · update #1

Thanks K, but did not work ether.

Should this work?

IIf([Expr10]=[All Stations]![STN CD],[All Stations]![STN CD],[Expr10])

2007-04-19 06:34:06 · update #2

1 answers

IIF needs THREE fields, not two.

Works = IIf([Expr12] Is Null,[Origin],[Expr12])
field 1= [Expr12] Is Null
field 2= [Origin]
field 3=[Expr12]

Your other two expressions lacks field 3.

EDIT: The new expression should work. (or at least not give you an error) What answer did you get? Why was it not what you were expecting? Add two clumns to view the intermediate numbers and you should see why immediately.

2007-04-19 05:36:27 · answer #1 · answered by Kasey C 7 · 0 0

fedest.com, questions and answers