Re: #Error



prepend one, InStrRev( "_" & [List Name] , "_") so there will be always
one.

Alternatively, use iif to test the result of InStrRev, and if it returns 0,
let your iif return 1 instead (or whatever the logic dictates).



Vanderghast, Access MVP


"SJW_OST" <SJWOST@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BE99C7B1-EF1B-4168-B0CE-0419BE0B4859@xxxxxxxxxxxxxxxx
I am using the following formula in my Query.

Correct: Left$([List Name],InStrRev([List Name],"_")-1)

I am using this formula to convert some data to the following;

"aaaa_hi_e_28" converts to "aaaa_hi_e" or
"aaaa_e_28" converts to "aaaa_e" or
"aaaa_hi_e_0528" converts to "aaaa_hi_e"

But, if I have some data that does not have an underscore & "date" at the
end, like D86547, I get #Error. How do I change the formula to just use
the
original name if #Error occurs?

Thank you in advance.


.