Removing a Leading Character

G

Guest

Hi all,

Need some help removing a leading character from many fields using 1 query.

[field1] has a Q in front of each entry(don't ask), how do I remove just
that Q from the entry using 1 query. Is it possible?

Thanks for the help.
 
F

fredg

Hi all,

Need some help removing a leading character from many fields using 1 query.

[field1] has a Q in front of each entry(don't ask), how do I remove just
that Q from the entry using 1 query. Is it possible?

Thanks for the help.

In a Select query...
NewColumn:IIf(Left([Field1],1) = "Q",Mid([Field1],2),[Field1])

Only if the first character is a "Q" will it remove it.
or....
NewColumn:Mid([Field1],2)
will remove the first character whether it is a "Q" or not.

Use either above expression in an update query to permanently remove
the character from the field.
 
V

Van T. Dinh

Mid([FieldWithStartingQ], 2)

will remove the leading "Q".

You can use this in a SELECT query if you want these temporary Q-removed
values as Calculated Field or you can use it in an UPDATE Query to
permanently change the values in the Table.
 

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