Trim Field To Show Left Of = Sign

  • Thread starter Thread starter Ella
  • Start date Start date
E

Ella

I am trying to trim a description field in a query for a combox look up.
I would like to remove all text and any spaces to the right of an = sign in
the description, eg (right of an = sign), after trim (right of an =). If
there is no = sign in the description, then show the whole description. Then
group by to remove any duplicates.

Thanks in advance
Ella
 
Ahh, Bonnie, I think you may have jumped the gun on this one (either
that, or I can't read either <grin>).

Ella is looking for everything LEFT of the = ... so, Ella, change
Bonnie's example to:

iif(instr(1,fieldname,"="),mid(fieldname,1,Instr(fieldname,"=")),fieldname)

then if instr finds an = you will get up to and including the =; if
there is no = you will get the entire field.
 
Bonnie,
Thank to you and Clif for your assistance.
I really appreciate it.

Regards
Ella

bhicks11 via AccessMonster.com said:
Oops, your right Clif. I transposed her Right. We could also do:

iif(instr(1,fieldname,"="),left(fieldname,Instr(fieldname,"=")-1),fieldname)

Thanks,

Bonnie
http://www.dataplus-svc.com

Clif said:
Ahh, Bonnie, I think you may have jumped the gun on this one (either
that, or I can't read either <grin>).

Ella is looking for everything LEFT of the = ... so, Ella, change
Bonnie's example to:

iif(instr(1,fieldname,"="),mid(fieldname,1,Instr(fieldname,"=")),fieldname)

then if instr finds an = you will get up to and including the =; if
there is no = you will get the entire field.
[quoted text clipped - 29 lines]
Thanks in advance
Ella
 

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

Similar Threads


Back
Top