using the IIF function in access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i am trying to set a certain field to a blank vaule if another field is >than
30,000 or >-30,000. i have set it up and it is working fine with changing
the value to a blank if it is 0ver 30,000, but i am not sure how to work in
the -30,000. this is what i have:

IIf([entitydiscretedata]![velocityflag]>30,000, "
",[entitydiscretedata]![velocity])

how can i make this also use anything over -30,000 show up blank. this is
kinda confusing with the negative in there and using >< signs. Well to me it
is. Is is less than -30,000 or >-30,000. i am trying to flag values like
-38345, -32466 etc.
 
There really are no shortcuts. You need to say:

IIf(([entitydiscretedata]![velocityflag]>30,000) Or ([entitydiscretedata]!
[velocityflag]<-30,000), "
",[entitydiscretedata]![velocity])

A better way would be to say:

IIf(Abs([entitydiscretedata]![velocityflag])>30,000, "
",[entitydiscretedata]![velocity])

The Abs() function returns the absolute value of the ![velocityflag], and
will return a <blank> whether the flag is >30,000 or <-30,000.

Hope this helps.

Sam said:
i am trying to set a certain field to a blank vaule if another field is >than
30,000 or >-30,000. i have set it up and it is working fine with changing
the value to a blank if it is 0ver 30,000, but i am not sure how to work in
the -30,000. this is what i have:

IIf([entitydiscretedata]![velocityflag]>30,000, "
",[entitydiscretedata]![velocity])

how can i make this also use anything over -30,000 show up blank. this is
kinda confusing with the negative in there and using >< signs. Well to me it
is. Is is less than -30,000 or >-30,000. i am trying to flag values like
-38345, -32466 etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top