Help with an expression

cmc2005

New member
Local time
Today, 03:01
Joined
May 6, 2005
Messages
6
Hi,

I'm trying to write an expression that performs one "/" expression based on a certain exception, and if else peforms something else. I can't get it to work. I'm sure something is wrong here -- does anyone know?

=IIf([SeriesTitle]=[Mediscope],Sum([Euro]/1.4),"[Euro]/1.2")

So basically if Mediscope is filled into the Series Title field then divide Euro field by 1.4, else divide by 1.2.

Can someone tell me what I did wrong?

Thanks!! :confused:
 
Why do you have SUM in the true condition, that's no good.
Is the second one suppose to return a litrial string? If not take the quotes off.
 
FoFa,

I had it in there without the SUM but it wasn't working. So I looked up some expressions and thought I needed it there. The second one is supposed to perform a calculation, so I'll take the quotes off.

So if I do:

=IIf([SeriesTitle]=[Mediscope],([Euro]/1.4),[Euro]/1.2")

This should take the Euro price and read the SeriesTitle field and if it's Mediscope it'll divide the number by 1.4? Otherwise it'll divide the Euro by 1.2? It still doesn't seem to be working right.

Thanks for your help...
 
I left that last " in there by accident. It's really:
=IIf([SeriesTitle]=[Mediscope],([Euro]/1.4),[Euro]/1.2)
 
ummmm

Mediscope is a field?
or
"Mediscope" is a string value that might be in the field [SeriesTitle]?

if Mediscope is a field, you have a weird table design and/or field-naming convention, but it will work as you posted whenever the fields [SeriesTitle],[Mediscope] and [Euro] exist and are not Null

if "Mediscope" is a potential value for text field [SeriesTitle], try:

=IIf([SeriesTitle]="Mediscope", ([Euro]/1.4), [Euro]/1.2)


izy
 

Users who are viewing this thread

Back
Top Bottom