J
jlute
Yesterday I posted a request to simplify an IIf and Doug Steele (any
relation to Marion L. Steele of Amherst, OH fame?) helped to go from
this:
UNEstNtWt: IIf([tblFGUOM].[UOMType]="WT",Round([UNNtWt]*0.05+[UNNtWt],
6),IIf([tblFGUOM].[UOMType]="VOL",Round([UNNtWt],6)))
to this:
UNEstNtWt: Switch([tblFGUOM].[UOMType]="WT",Round([UNNtWt]*0.05+
[UNNtWt],6),[tblFGUOM].[UOMType]="VOL",Round([UNNtWt],6))
While this is more simple in my mind - Access doesn't think so. The
reason I posted this problem is because I've got a VERY complex query
and this "little" seemingly benign IIf statement has taken things into
the Query Too Complex Zone.
I did some more query design and whittled things down to this:
UNEstNtWt: Switch([UOMType]="WT",Round([UNNtWt]*0.05+[UNNtWt],6),
[UOMType]="VOL",Round([UNNtWt],6))
Still too complex. I even tried this:
UNEstNtWt: IIf([UOMType]="WT",Round([UNNtWt]*0.05+[UNNtWt],6) Or
[UOMType]="VOL",Round([UNNtWt],6))
I tried removing 1 joined subquery and 2 joined tables as well as
about 20 other fields - compacted and repaired - I then got the
"System resource exceeded" deal.
!!!!!
The query has about 72 fields. When I leave them ALL in and everything
else as is and then change the IIf to this:
UNEstNtWt: Round([UNNtWt]*0.05+[UNNtWt],6)
then everything is fine!
I absolutely NEED to distinguish when a UOMType is WT or VOL and then
calculate accordingly but this makes things too complex and it doesn't
make sense considering my test of removing the stuff as noted above.
WHAT THE HECK!!!???
The "solution" to a Query too complex is to REMOVE fields, tables,
etc. I did that to no end! WHY is this one little IIf creating such
havoc?
Any help is greatly appreciated. This is without doubt the most
aggravating problem I've ever had.
THANKS!
relation to Marion L. Steele of Amherst, OH fame?) helped to go from
this:
UNEstNtWt: IIf([tblFGUOM].[UOMType]="WT",Round([UNNtWt]*0.05+[UNNtWt],
6),IIf([tblFGUOM].[UOMType]="VOL",Round([UNNtWt],6)))
to this:
UNEstNtWt: Switch([tblFGUOM].[UOMType]="WT",Round([UNNtWt]*0.05+
[UNNtWt],6),[tblFGUOM].[UOMType]="VOL",Round([UNNtWt],6))
While this is more simple in my mind - Access doesn't think so. The
reason I posted this problem is because I've got a VERY complex query
and this "little" seemingly benign IIf statement has taken things into
the Query Too Complex Zone.
I did some more query design and whittled things down to this:
UNEstNtWt: Switch([UOMType]="WT",Round([UNNtWt]*0.05+[UNNtWt],6),
[UOMType]="VOL",Round([UNNtWt],6))
Still too complex. I even tried this:
UNEstNtWt: IIf([UOMType]="WT",Round([UNNtWt]*0.05+[UNNtWt],6) Or
[UOMType]="VOL",Round([UNNtWt],6))
I tried removing 1 joined subquery and 2 joined tables as well as
about 20 other fields - compacted and repaired - I then got the
"System resource exceeded" deal.
!!!!!
The query has about 72 fields. When I leave them ALL in and everything
else as is and then change the IIf to this:
UNEstNtWt: Round([UNNtWt]*0.05+[UNNtWt],6)
then everything is fine!
I absolutely NEED to distinguish when a UOMType is WT or VOL and then
calculate accordingly but this makes things too complex and it doesn't
make sense considering my test of removing the stuff as noted above.
WHAT THE HECK!!!???
The "solution" to a Query too complex is to REMOVE fields, tables,
etc. I did that to no end! WHY is this one little IIf creating such
havoc?
Any help is greatly appreciated. This is without doubt the most
aggravating problem I've ever had.
THANKS!