DUXPrice: IIf (Left([WBCode],4)="X"),([WBCost]*2)*(9/10),Null))
I want to check the 4th character of the WBCode - not sure what I am doing wrong?
DUXPrice: IIf (Left([WBCode],4)="X"),([WBCost]*2)*(9/10),Null))
I want to check the 4th character of the WBCode - not sure what I am doing wrong?
Try the Mid(string, start[, length]) function
DUXPrice: IIf (Mid([WBCode],4,1)="X"),([WBCost]*2)*(9/10),Null))
If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
Bob Fitzpatrick
Google Ms Access functions Left()not sure what I am doing wrong?
see and bookmark http://www.techonthenet.com/access/functions/index.php
DUXPrice: IIf (Mid([WBCode],4,1)="X"),([WBCost]*2)*(9/10),Null))
function containing wrong number of arguments error
Try
DUXPrice: IIf (Mid([WBCode],4,1)="X",([WBCost]*2)*(9/10),Null))
DUXPrice: IIf(Left([WBCode],4="X"),([WBCost]*2)*(9/10),0)
This is not giving me an error when I save it - but my value is #ERROR
wrong number of arguments didn't work
Where do you get WBCode from? How is it defined? Do you have missing values in your data source?
Have you tried a sample query to just output WBCode to see what values exist?
Tell us more about your situation.
And bookmark the page I mentioned earlier.
DUXPrice: IIf(Left([WBCode],4)="X",([WBCost]*2)*(9/10),0)
Try:
DUXPrice: IIf(Mid([WBCode],4,1)="X",([WBCost]*2)*(9/10),Null)
If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
Bob Fitzpatrick
The field wbcode is an entered field - a mandatory field (required - never an empty field)
the rest is calculation - a sample code would be 06-X0011
I have the query expression field as a number with 2 decimals
DUXPrice: IIf(Left([WBCode],4="X"),([WBCost]*2)*(9/10),0)
The fourth position from the left should only find the X - if some of the values in the field are only 2 characters (NA) would that cause the problem? I will try to make sure all codes have at least 4 characters and try.
This does not give me an error when I save it - but it does give me a #ERROR for the value
Checked all of the codes they all have 4 characters or more.
I'm really stuck on this one - doesn't make sense
Did you try the code in my post #8? I haven't executed it, but I think it matches your requirement.
If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
Bob Fitzpatrick
this one
DUXPrice: IIf(Left([WBCode],4)="X",([WBCost]*2)*(9/10),0)
I get all 0's - there should be 12 of my rows that should have a value
Ex 06-X0011 (I have 12 rows that an X for the 4th character value
I added an expression
Left([WBCode],4)
if gives me the first 4 characters - not just the 4th character - how can I strip the first 3?