IIf Statement Calculation

G

Guest

I need an IIf statement similar to this one...

Volume: IIf(([Size]=("*/5")),(5*[Units]),[Size])

It needs to multiply the Units field times 5 if the Size field ends in /5.
There are letters before the /5, but the /5 makes it unique. I believe some
of the context is not correct in the statement as it keeps returning the Size
field and performing no calculations. Could someone please help with this
statement?
 
G

Guest

Try using iif(right([size],2) ="/5",5 * [units],[size]) instead and you may
get better results. Assuming I've understood what you're after, and I think
you'll get better results.
 
G

Guest

Thanks, just wondering - is it possible to include wildcards * in iif
expressions?

Daz said:
Try using iif(right([size],2) ="/5",5 * [units],[size]) instead and you may
get better results. Assuming I've understood what you're after, and I think
you'll get better results.

GOL said:
I need an IIf statement similar to this one...

Volume: IIf(([Size]=("*/5")),(5*[Units]),[Size])

It needs to multiply the Units field times 5 if the Size field ends in /5.
There are letters before the /5, but the /5 makes it unique. I believe some
of the context is not correct in the statement as it keeps returning the Size
field and performing no calculations. Could someone please help with this
statement?
 
G

Guest

You can use a wildcard if you also use the Like function.




GOL said:
Thanks, just wondering - is it possible to include wildcards * in iif
expressions?

Daz said:
Try using iif(right([size],2) ="/5",5 * [units],[size]) instead and you may
get better results. Assuming I've understood what you're after, and I think
you'll get better results.

GOL said:
I need an IIf statement similar to this one...

Volume: IIf(([Size]=("*/5")),(5*[Units]),[Size])

It needs to multiply the Units field times 5 if the Size field ends in /5.
There are letters before the /5, but the /5 makes it unique. I believe some
of the context is not correct in the statement as it keeps returning the Size
field and performing no calculations. Could someone please help with this
statement?
 

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

Top